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.

765 lines
20 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. cnpdef.h
  5. Abstract:
  6. Main private header file for the Cluster Network Protocol.
  7. Author:
  8. Mike Massa (mikemas) July 29, 1996
  9. Revision History:
  10. Who When What
  11. -------- -------- ----------------------------------------------
  12. mikemas 07-29-96 created
  13. Notes:
  14. --*/
  15. #ifndef _CNPDEF_INCLUDED_
  16. #define _CNPDEF_INCLUDED_
  17. #include <fipsapi.h>
  18. #include <sspi.h>
  19. //
  20. // Forward declarations
  21. //
  22. typedef struct _CNP_INTERFACE *PCNP_INTERFACE;
  23. //
  24. // Priority definitions
  25. //
  26. #define CnpIsHigherPriority(_p1, _p2) ((_p1) < (_p2))
  27. #define CnpIsLowerPriority(_p1, _p2) ((_p1) > (_p2))
  28. #define CnpIsEqualPriority(_p1, _p2) ((_p1) == (_p2))
  29. //
  30. // Multicast Group Object
  31. //
  32. // This structure contains the data needed to implement a multicast
  33. // endpoint on a network.
  34. //
  35. typedef struct _CNP_MULTICAST_GROUP {
  36. ULONG McastNetworkBrand;
  37. PTRANSPORT_ADDRESS McastTdiAddress;
  38. ULONG McastTdiAddressLength;
  39. PVOID Key;
  40. ULONG KeyLength;
  41. DESTable DesTable;
  42. PVOID Salt;
  43. ULONG SaltLength;
  44. ULONG SignatureLength;
  45. ULONG RefCount;
  46. } CNP_MULTICAST_GROUP, *PCNP_MULTICAST_GROUP;
  47. //
  48. // Network Object
  49. //
  50. // This structure represents a communication link between the nodes of a
  51. // cluster. It references a particular transport protocol and interface
  52. // configured on the local system. It also links together all of the
  53. // interface objects for the nodes attached to the network.
  54. //
  55. // Networks are identified by a small integer assigned by the Cluster
  56. // Service. Network objects are stored in a global array indexed by
  57. // the network ID.
  58. //
  59. typedef struct {
  60. LIST_ENTRY Linkage;
  61. CN_SIGNATURE_FIELD
  62. CL_NETWORK_ID Id;
  63. CN_LOCK Lock;
  64. CN_IRQL Irql;
  65. ULONG RefCount;
  66. ULONG ActiveRefCount;
  67. CLUSNET_NETWORK_STATE State;
  68. ULONG Flags;
  69. ULONG Priority;
  70. HANDLE DatagramHandle;
  71. PFILE_OBJECT DatagramFileObject;
  72. PDEVICE_OBJECT DatagramDeviceObject;
  73. TDI_PROVIDER_INFO ProviderInfo;
  74. PIRP PendingDeleteIrp;
  75. PIRP PendingOfflineIrp;
  76. WORK_QUEUE_ITEM ExWorkItem;
  77. PCNP_MULTICAST_GROUP CurrentMcastGroup;
  78. PCNP_MULTICAST_GROUP PreviousMcastGroup;
  79. CX_CLUSTERSCREEN McastReachableNodes;
  80. ULONG McastReachableCount;
  81. } CNP_NETWORK, *PCNP_NETWORK;
  82. #define CNP_NETWORK_SIG 'kwtn'
  83. extern LIST_ENTRY CnpNetworkList;
  84. extern CN_LOCK CnpNetworkListLock;
  85. #define CNP_NET_FLAG_DELETING 0x00000001
  86. #define CNP_NET_FLAG_PARTITIONED 0x00000002
  87. #define CNP_NET_FLAG_RESTRICTED 0x00000004
  88. #define CNP_NET_FLAG_LOCALDISCONN 0x00000008
  89. #define CNP_NET_FLAG_MULTICAST 0x00000010
  90. #define CNP_NET_FLAG_MCASTSORTED 0x00000020
  91. #define CnpIsNetworkDeleting(_network) \
  92. (((_network)->Flags & CNP_NET_FLAG_DELETING) != 0)
  93. #define CnpIsValidNetworkId(_id) ( ((_id) != ClusterAnyNetworkId ) && \
  94. ((_id) != ClusterInvalidNetworkId))
  95. #define CnpIsNetworkRestricted(_network) \
  96. (((_network)->Flags & CNP_NET_FLAG_RESTRICTED) != 0)
  97. #define CnpIsNetworkLocalDisconn(_network) \
  98. (((_network)->Flags & CNP_NET_FLAG_LOCALDISCONN) != 0)
  99. #define CnpIsNetworkMulticastCapable(_network) \
  100. (((_network)->Flags & CNP_NET_FLAG_MULTICAST) != 0)
  101. #define CnpIsNetworkMulticastSorted(_network) \
  102. (((_network)->Flags & CNP_NET_FLAG_MCASTSORTED) != 0)
  103. #define CnpNetworkResetMcastReachableNodes(_network) \
  104. (RtlZeroMemory( \
  105. &((_network)->McastReachableNodes), \
  106. sizeof((_network)->McastReachableNodes) \
  107. ))
  108. /*
  109. (BYTE((_network)->McastReachableNodes, INT_NODE(CnLocalNodeId)) \
  110. = (1 << (BYTEL-1-BIT(INT_NODE(CnLocalNodeId)))))
  111. */
  112. //
  113. // Node Object
  114. //
  115. // This structure represents a cluster node. One exists for each
  116. // defined member of a cluster.
  117. //
  118. // Nodes are identified by a small integer assigned by the Cluster Service.
  119. // Node objects are stored in a global array indexed by node ID.
  120. //
  121. // Note that the order of the CLUSTER_NODE_COMM_STATE enumeration *is* important.
  122. //
  123. typedef struct {
  124. LIST_ENTRY Linkage;
  125. CN_SIGNATURE_FIELD
  126. CL_NODE_ID Id;
  127. CN_LOCK Lock;
  128. CN_IRQL Irql;
  129. ULONG RefCount;
  130. CLUSNET_NODE_COMM_STATE CommState;
  131. CLUSNET_NODE_STATE MMState;
  132. ULONG Flags;
  133. LIST_ENTRY InterfaceList;
  134. PCNP_INTERFACE CurrentInterface;
  135. PIRP PendingDeleteIrp;
  136. BOOLEAN HBWasMissed;
  137. BOOLEAN NodeDownIssued;
  138. ULONG MissedHBs;
  139. } CNP_NODE, *PCNP_NODE;
  140. #define CNP_NODE_SIG 'edon'
  141. extern PCNP_NODE * CnpNodeTable;
  142. extern CN_LOCK CnpNodeTableLock;
  143. extern PCNP_NODE CnpLocalNode;
  144. #define CNP_NODE_FLAG_DELETING 0x00000001
  145. #define CNP_NODE_FLAG_UNREACHABLE 0x00000002
  146. #define CNP_NODE_FLAG_LOCAL 0x00000010
  147. #define CnpIsNodeDeleting(_node) \
  148. ((_node)->Flags & CNP_NODE_FLAG_DELETING)
  149. #define CnpIsNodeLocal(_node) \
  150. ((_node)->Flags & CNP_NODE_FLAG_LOCAL)
  151. #define CnpIsNodeUnreachable(_node) \
  152. ((_node)->Flags & CNP_NODE_FLAG_UNREACHABLE)
  153. //++
  154. //
  155. // Routine Description:
  156. //
  157. // Callback routine for CnpWalkNodeTable. Performs an operation on
  158. // the specified node.
  159. //
  160. // Arguments:
  161. //
  162. // UpdateNode - A pointer to the node on which to operate.
  163. //
  164. // UpdateContext - Operation-specific context
  165. //
  166. // NodeTableIrql - The IRQL at which the CnpNodeTableLock was acquired.
  167. //
  168. // Return Value:
  169. //
  170. // Returns TRUE if the CnpNodeTable lock is still held.
  171. // Returns FALSE if the CnpNodeTable lock is released.
  172. //
  173. // Notes:
  174. //
  175. // Called with both the CnpNodeTable and node object locks held.
  176. // The node object lock is released upon return.
  177. //
  178. //--
  179. typedef
  180. BOOLEAN
  181. (*PCNP_NODE_UPDATE_ROUTINE)(
  182. IN PCNP_NODE UpdateNode,
  183. IN PVOID UpdateContext,
  184. IN CN_IRQL NodeTableIrql
  185. );
  186. //
  187. // Interface Object
  188. //
  189. // This structure represents a node's transport interface to a network.
  190. // It contains a transport address which may be used to communicate
  191. // with the specified node using the specified network.
  192. //
  193. // Interface objects are linked onto lists in the associated node objects.
  194. // They are identified by a {node, network} tuple.
  195. //
  196. // The interfaces on a node are ranked based on their state and priority.
  197. // Numerically higher state values are ranked ahead of lower values.
  198. // For interfaces with the same state, Numerically lower priority values
  199. // are ranked ahead of lower values. Priority values fall in the range
  200. // 0x1-0xFFFFFFFF. State values are defined by CLUSNET_INTERFACE_STATE
  201. // enumeration. By default, interfaces inherit their priority from the
  202. // associated network. In this case, the Priority field will contain the
  203. // network's priority value, and the CNP_IF_FLAG_USE_NETWORK_PRIORITY flag
  204. // will be set in the Flags field.
  205. //
  206. // Note that the order of the CLUSNET_INTERFACE_STATE enumeration
  207. // *is* important.
  208. //
  209. typedef struct _CNP_INTERFACE {
  210. LIST_ENTRY NodeLinkage;
  211. CN_SIGNATURE_FIELD
  212. PCNP_NODE Node;
  213. PCNP_NETWORK Network;
  214. CLUSNET_INTERFACE_STATE State;
  215. ULONG Priority;
  216. ULONG Flags;
  217. ULONG MissedHBs;
  218. ULONG SequenceToSend;
  219. ULONG LastSequenceReceived;
  220. ULONG McastDiscoverCount;
  221. ULONG McastRediscoveryCountdown;
  222. ULONG AdapterWMIProviderId;
  223. ULONG TdiAddressLength;
  224. TRANSPORT_ADDRESS TdiAddress;
  225. } CNP_INTERFACE;
  226. #define CNP_INTERFACE_SIG ' fi'
  227. #define CNP_INTERFACE_MCAST_DISCOVERY 0x5
  228. #define CNP_INTERFACE_MCAST_REDISCOVERY 3000 // 1 hr at 1.2 hbs/sec
  229. #define CNP_IF_FLAG_USE_NETWORK_PRIORITY 0x00000001
  230. #define CNP_IF_FLAG_RECVD_MULTICAST 0x00000002
  231. #define CnpIsInterfaceUsingNetworkPriority(_if) \
  232. ( (_if)->Flags & CNP_IF_FLAG_USE_NETWORK_PRIORITY )
  233. #define CnpInterfaceQueryReceivedMulticast(_if) \
  234. ( (_if)->Flags & CNP_IF_FLAG_RECVD_MULTICAST )
  235. #define CnpInterfaceSetReceivedMulticast(_if) \
  236. ( (_if)->Flags |= CNP_IF_FLAG_RECVD_MULTICAST )
  237. #define CnpInterfaceClearReceivedMulticast(_if) \
  238. ( (_if)->Flags &= ~CNP_IF_FLAG_RECVD_MULTICAST )
  239. //++
  240. //
  241. // Routine Description:
  242. //
  243. // Callback routine for CnpWalkInterfacesOnNetwork and
  244. // CnpWalkInterfacesOnNode routines. Performs a specified
  245. // operation on all interfaces.
  246. //
  247. // Arguments:
  248. //
  249. // UpdateInterface - A pointer to the interface on which to operate.
  250. //
  251. // Return Value:
  252. //
  253. // None.
  254. //
  255. // Notes:
  256. //
  257. // Called with the associated node and network object locks held.
  258. // Mut return with the network object lock released.
  259. // May not release node object lock at any time.
  260. //
  261. //--
  262. typedef
  263. VOID
  264. (*PCNP_INTERFACE_UPDATE_ROUTINE)(
  265. IN PCNP_INTERFACE UpdateInterface
  266. );
  267. //
  268. // Send Request Pool
  269. //
  270. typedef struct {
  271. USHORT UpperProtocolHeaderLength;
  272. ULONG UpperProtocolContextSize;
  273. UCHAR UpperProtocolNumber;
  274. UCHAR CnpVersionNumber;
  275. UCHAR Pad[2];
  276. } CNP_SEND_REQUEST_POOL_CONTEXT, *PCNP_SEND_REQUEST_POOL_CONTEXT;
  277. //
  278. // Forward Declaration
  279. //
  280. typedef struct _CNP_SEND_REQUEST *PCNP_SEND_REQUEST;
  281. typedef
  282. VOID
  283. (*PCNP_SEND_COMPLETE_ROUTINE)(
  284. IN NTSTATUS Status,
  285. IN OUT PULONG BytesSent,
  286. IN PCNP_SEND_REQUEST SendRequest,
  287. IN PMDL DataMdl
  288. );
  289. //
  290. // Send Request Structure
  291. //
  292. typedef struct _CNP_SEND_REQUEST {
  293. CN_RESOURCE CnResource;
  294. PMDL HeaderMdl;
  295. PVOID CnpHeader;
  296. PIRP UpperProtocolIrp;
  297. PVOID UpperProtocolHeader;
  298. USHORT UpperProtocolHeaderLength;
  299. KPROCESSOR_MODE UpperProtocolIrpMode;
  300. UCHAR Pad;
  301. PMDL UpperProtocolMdl;
  302. PVOID UpperProtocolContext;
  303. PCNP_SEND_COMPLETE_ROUTINE CompletionRoutine;
  304. PCNP_NETWORK Network;
  305. PCNP_MULTICAST_GROUP McastGroup;
  306. TDI_CONNECTION_INFORMATION TdiSendDatagramInfo;
  307. } CNP_SEND_REQUEST;
  308. //
  309. // Internal Init/Cleanup routines
  310. //
  311. //
  312. // Internal Node Routines
  313. //
  314. VOID
  315. CnpWalkNodeTable(
  316. PCNP_NODE_UPDATE_ROUTINE UpdateRoutine,
  317. PVOID UpdateContext
  318. );
  319. NTSTATUS
  320. CnpValidateAndFindNode(
  321. IN CL_NODE_ID NodeId,
  322. OUT PCNP_NODE * Node
  323. );
  324. PCNP_NODE
  325. CnpLockedFindNode(
  326. IN CL_NODE_ID NodeId,
  327. IN CN_IRQL NodeTableIrql
  328. );
  329. PCNP_NODE
  330. CnpFindNode(
  331. IN CL_NODE_ID NodeId
  332. );
  333. VOID
  334. CnpOfflineNode(
  335. PCNP_NODE Node
  336. );
  337. VOID
  338. CnpDeclareNodeUnreachable(
  339. PCNP_NODE Node
  340. );
  341. VOID
  342. CnpDeclareNodeReachable(
  343. PCNP_NODE Node
  344. );
  345. VOID
  346. CnpReferenceNode(
  347. PCNP_NODE Node
  348. );
  349. VOID
  350. CnpDereferenceNode(
  351. PCNP_NODE Node
  352. );
  353. //
  354. // Internal Network Routines
  355. //
  356. VOID
  357. CnpReferenceNetwork(
  358. PCNP_NETWORK Network
  359. );
  360. VOID
  361. CnpDereferenceNetwork(
  362. PCNP_NETWORK Network
  363. );
  364. VOID
  365. CnpActiveReferenceNetwork(
  366. PCNP_NETWORK Network
  367. );
  368. VOID
  369. CnpActiveDereferenceNetwork(
  370. PCNP_NETWORK Network
  371. );
  372. PCNP_NETWORK
  373. CnpFindNetwork(
  374. IN CL_NETWORK_ID NetworkId
  375. );
  376. VOID
  377. CnpDeleteNetwork(
  378. PCNP_NETWORK Network,
  379. CN_IRQL NetworkListIrql
  380. );
  381. VOID
  382. CnpFreeMulticastGroup(
  383. IN PCNP_MULTICAST_GROUP Group
  384. );
  385. #define CnpReferenceMulticastGroup(_group) \
  386. (InterlockedIncrement(&((_group)->RefCount)))
  387. #define CnpDereferenceMulticastGroup(_group) \
  388. if (InterlockedDecrement(&((_group)->RefCount)) == 0) { \
  389. CnpFreeMulticastGroup(_group); \
  390. }
  391. BOOLEAN
  392. CnpSortMulticastNetwork(
  393. IN PCNP_NETWORK Network,
  394. IN BOOLEAN RaiseEvent,
  395. OUT CX_CLUSTERSCREEN * McastReachableNodes OPTIONAL
  396. );
  397. BOOLEAN
  398. CnpMulticastChangeNodeReachability(
  399. IN PCNP_NETWORK Network,
  400. IN PCNP_NODE Node,
  401. IN BOOLEAN Reachable,
  402. IN BOOLEAN RaiseEvent,
  403. OUT CX_CLUSTERSCREEN * NewMcastReachableNodes OPTIONAL
  404. );
  405. PCNP_NETWORK
  406. CnpGetBestMulticastNetwork(
  407. VOID
  408. );
  409. //
  410. // Internal Interface Routines
  411. //
  412. VOID
  413. CnpWalkInterfacesOnNode(
  414. PCNP_NODE Node,
  415. PCNP_INTERFACE_UPDATE_ROUTINE UpdateRoutine
  416. );
  417. VOID
  418. CnpWalkInterfacesOnNetwork(
  419. PCNP_NETWORK Network,
  420. PCNP_INTERFACE_UPDATE_ROUTINE UpdateRoutine
  421. );
  422. NTSTATUS
  423. CnpOnlinePendingInterface(
  424. PCNP_INTERFACE Interface
  425. );
  426. VOID
  427. CnpOnlinePendingInterfaceWrapper(
  428. PCNP_INTERFACE Interface
  429. );
  430. NTSTATUS
  431. CnpOfflineInterface(
  432. PCNP_INTERFACE Interface
  433. );
  434. VOID
  435. CnpOfflineInterfaceWrapper(
  436. PCNP_INTERFACE Interface
  437. );
  438. NTSTATUS
  439. CnpOnlineInterface(
  440. PCNP_INTERFACE Interface
  441. );
  442. NTSTATUS
  443. CnpFailInterface(
  444. PCNP_INTERFACE Interface
  445. );
  446. VOID
  447. CnpDeleteInterface(
  448. IN PCNP_INTERFACE Interface
  449. );
  450. VOID
  451. CnpReevaluateInterfaceRole(
  452. IN PCNP_INTERFACE Interface
  453. );
  454. VOID
  455. CnpRecalculateInterfacePriority(
  456. IN PCNP_INTERFACE Interface
  457. );
  458. VOID
  459. CnpUpdateNodeCurrentInterface(
  460. PCNP_NODE Node
  461. );
  462. VOID
  463. CnpResetAndOnlinePendingInterface(
  464. IN PCNP_INTERFACE Interface
  465. );
  466. NTSTATUS
  467. CnpFindInterface(
  468. IN CL_NODE_ID NodeId,
  469. IN CL_NETWORK_ID NetworkId,
  470. OUT PCNP_INTERFACE * Interface
  471. );
  472. //
  473. // Send Routines.
  474. //
  475. PCN_RESOURCE_POOL
  476. CnpCreateSendRequestPool(
  477. IN UCHAR CnpVersionNumber,
  478. IN UCHAR UpperProtocolNumber,
  479. IN USHORT UpperProtocolHeaderSize,
  480. IN USHORT UpperProtocolContextSize,
  481. IN USHORT PoolDepth
  482. );
  483. #define CnpDeleteSendRequestPool(_pool) \
  484. { \
  485. CnDrainResourcePool(_pool); \
  486. CnFreePool(_pool); \
  487. }
  488. NTSTATUS
  489. CnpSendPacket(
  490. IN PCNP_SEND_REQUEST SendRequest,
  491. IN CL_NODE_ID DestNodeId,
  492. IN PMDL DataMdl,
  493. IN USHORT DataLength,
  494. IN BOOLEAN CheckDestState,
  495. IN CL_NETWORK_ID NetworkId OPTIONAL
  496. );
  497. VOID
  498. CcmpSendPoisonPacket(
  499. IN PCNP_NODE Node,
  500. IN PCX_SEND_COMPLETE_ROUTINE CompletionRoutine, OPTIONAL
  501. IN PVOID CompletionContext, OPTIONAL
  502. IN PCNP_NETWORK Network, OPTIONAL
  503. IN PIRP Irp OPTIONAL
  504. );
  505. //
  506. // Receive Routines
  507. //
  508. NTSTATUS
  509. CcmpReceivePacketHandler(
  510. IN PCNP_NETWORK Network,
  511. IN CL_NODE_ID SourceNodeId,
  512. IN ULONG CnpReceiveFlags,
  513. IN ULONG TdiReceiveDatagramFlags,
  514. IN ULONG BytesIndicated,
  515. IN ULONG BytesAvailable,
  516. OUT PULONG BytesTaken,
  517. IN PVOID Tsdu,
  518. OUT PIRP * Irp
  519. );
  520. VOID
  521. CnpReceiveHeartBeatMessage(
  522. IN PCNP_NETWORK Network,
  523. IN CL_NODE_ID SourceNodeId,
  524. IN ULONG SeqNumber,
  525. IN ULONG AckNumber,
  526. IN BOOLEAN Multicast
  527. );
  528. VOID
  529. CnpReceivePoisonPacket(
  530. IN PCNP_NETWORK Network,
  531. IN CL_NODE_ID SourceNodeId,
  532. IN ULONG SeqNumber
  533. );
  534. //
  535. // TDI routines
  536. //
  537. NTSTATUS
  538. CnpTdiReceiveDatagramHandler(
  539. IN PVOID TdiEventContext,
  540. IN LONG SourceAddressLength,
  541. IN PVOID SourceAddress,
  542. IN LONG OptionsLength,
  543. IN PVOID Options,
  544. IN ULONG ReceiveDatagramFlags,
  545. IN ULONG BytesIndicated,
  546. IN ULONG BytesAvailable,
  547. OUT PULONG BytesTaken,
  548. IN PVOID Tsdu,
  549. OUT PIRP * IoRequestPacket
  550. );
  551. NTSTATUS
  552. CnpTdiErrorHandler(
  553. IN PVOID TdiEventContext,
  554. IN NTSTATUS Status
  555. );
  556. NTSTATUS
  557. CnpTdiSetEventHandler(
  558. IN PFILE_OBJECT FileObject,
  559. IN PDEVICE_OBJECT DeviceObject,
  560. IN ULONG EventType,
  561. IN PVOID EventHandler,
  562. IN PVOID EventContext,
  563. IN PIRP ClientIrp OPTIONAL
  564. );
  565. NTSTATUS
  566. CnpIssueDeviceControl (
  567. IN PFILE_OBJECT FileObject,
  568. IN PDEVICE_OBJECT DeviceObject,
  569. IN PVOID IrpParameters,
  570. IN ULONG IrpParametersLength,
  571. IN PVOID MdlBuffer,
  572. IN ULONG MdlBufferLength,
  573. IN UCHAR MinorFunction,
  574. IN PIRP ClientIrp OPTIONAL
  575. );
  576. VOID
  577. CnpAttachSystemProcess(
  578. VOID
  579. );
  580. VOID
  581. CnpDetachSystemProcess(
  582. VOID
  583. );
  584. NTSTATUS
  585. CnpOpenDevice(
  586. IN LPWSTR DeviceName,
  587. OUT HANDLE *Handle
  588. );
  589. NTSTATUS
  590. CnpZwDeviceControl(
  591. IN HANDLE Handle,
  592. IN ULONG IoControlCode,
  593. IN PVOID InputBuffer,
  594. IN ULONG InputBufferLength,
  595. IN PVOID OutputBuffer,
  596. IN ULONG OutputBufferLength
  597. );
  598. NTSTATUS
  599. CnpSetTcpInfoEx(
  600. IN HANDLE Handle,
  601. IN ULONG Entity,
  602. IN ULONG Class,
  603. IN ULONG Type,
  604. IN ULONG Id,
  605. IN PVOID Value,
  606. IN ULONG ValueLength
  607. );
  608. #define CnpIsIrpStackSufficient(_irp, _targetdevice) \
  609. ((_irp)->CurrentLocation - (_targetdevice)->StackSize >= 1)
  610. #define CnpIsIPv4McastTransportAddress(_ta) \
  611. ( (((PTA_IP_ADDRESS)(_ta))->Address[0].AddressType \
  612. == TDI_ADDRESS_TYPE_IP \
  613. ) \
  614. && ((((PTA_IP_ADDRESS)(_ta))->Address[0].Address[0].in_addr \
  615. & 0xf0) \
  616. == 0xe0 \
  617. ) \
  618. )
  619. #define CnpIsIPv4McastSameGroup(_ta1, _ta2) \
  620. ( ((PTA_IP_ADDRESS)(_ta1))->Address[0].Address[0].in_addr == \
  621. ((PTA_IP_ADDRESS)(_ta2))->Address[0].Address[0].in_addr \
  622. )
  623. //
  624. // Signature mechanisms.
  625. //
  626. extern FIPS_FUNCTION_TABLE CxFipsFunctionTable;
  627. // Pad the signature length to be an even multiple of DES_BLOCKLEN.
  628. #define CX_SIGNATURE_LENGTH \
  629. (((A_SHA_DIGEST_LEN % DES_BLOCKLEN) == 0) ? \
  630. A_SHA_DIGEST_LEN : \
  631. A_SHA_DIGEST_LEN + DES_BLOCKLEN - (A_SHA_DIGEST_LEN % DES_BLOCKLEN))
  632. NTSTATUS
  633. CnpSignMulticastMessage(
  634. IN PCNP_SEND_REQUEST SendRequest,
  635. IN PMDL DataMdl,
  636. IN OUT CL_NETWORK_ID * NetworkId,
  637. OUT ULONG * SigLen OPTIONAL
  638. );
  639. NTSTATUS
  640. CnpVerifyMulticastMessage(
  641. IN PCNP_NETWORK Network,
  642. IN PVOID Tsdu,
  643. IN ULONG TsduLength,
  644. IN ULONG ExpectedPayload,
  645. OUT ULONG * BytesTaken,
  646. OUT BOOLEAN * CurrentGroup
  647. );
  648. #endif // ifndef _CNPDEF_INCLUDED_
  649.