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.

170 lines
4.4 KiB

  1. /*++
  2. Copyright(c) 1999-2000 Microsoft Corporation
  3. Module Name:
  4. brdgfwd.h
  5. Abstract:
  6. Ethernet MAC level bridge.
  7. Forwarding engine section
  8. PUBLIC header
  9. Author:
  10. Mark Aiken
  11. (original bridge by Jameel Hyder)
  12. Environment:
  13. Kernel mode driver
  14. Revision History:
  15. Feb 2000 - Original version
  16. --*/
  17. // ===========================================================================
  18. //
  19. // PROTOTYPES
  20. //
  21. // ===========================================================================
  22. NTSTATUS
  23. BrdgFwdDriverInit();
  24. VOID
  25. BrdgFwdCleanup();
  26. NDIS_STATUS
  27. BrdgFwdSendBuffer(
  28. IN PADAPT pAdapt,
  29. IN PUCHAR pPacketData,
  30. IN UINT DataSize
  31. );
  32. // This serves as a ProtocolReceive function
  33. NDIS_STATUS
  34. BrdgFwdReceive(
  35. IN NDIS_HANDLE ProtocolBindingContext,
  36. IN NDIS_HANDLE MacReceiveContext,
  37. IN PVOID pHeader,
  38. IN UINT HeaderSize,
  39. IN PVOID pLookAheadBuffer,
  40. IN UINT LookAheadSize,
  41. IN UINT PacketSize
  42. );
  43. // This serves as a ProtocolTransferDataComplete function
  44. VOID
  45. BrdgFwdTransferComplete(
  46. IN NDIS_HANDLE ProtocolBindingContext,
  47. IN PNDIS_PACKET pPacket,
  48. IN NDIS_STATUS Status,
  49. IN UINT BytesTransferred
  50. );
  51. // This serves as a ProtocolReceivePacket function
  52. INT
  53. BrdgFwdReceivePacket(
  54. IN NDIS_HANDLE ProtocolBindingContext,
  55. IN PNDIS_PACKET Packet
  56. );
  57. // This serves as a MiniportSendPackets function
  58. NDIS_STATUS
  59. BrdgFwdSendPacket(
  60. IN PNDIS_PACKET pPacket
  61. );
  62. // This serves as a ProtocolSendComplete function
  63. VOID
  64. BrdgFwdSendComplete(
  65. IN NDIS_HANDLE ProtocolBindingContext,
  66. IN PNDIS_PACKET pPacket,
  67. IN NDIS_STATUS Status
  68. );
  69. // This serves as a MiniportReturnPacket function
  70. VOID
  71. BrdgFwdReturnIndicatedPacket(
  72. IN NDIS_HANDLE MiniportAdapterContext,
  73. IN PNDIS_PACKET pPacket
  74. );
  75. // Compatibility-mode support functions
  76. PNDIS_PACKET
  77. BrdgFwdMakeCompatCopyPacket(
  78. IN PNDIS_PACKET pBasePacket,
  79. OUT PUCHAR *pPacketData,
  80. OUT PUINT packetDataSize,
  81. BOOLEAN bCountAsLocalSend
  82. );
  83. VOID
  84. BrdgFwdSendPacketForCompat(
  85. IN PNDIS_PACKET pPacket,
  86. IN PADAPT pAdapt
  87. );
  88. VOID BrdgFwdReleaseCompatPacket(
  89. IN PNDIS_PACKET pPacket
  90. );
  91. VOID
  92. BrdgFwdIndicatePacketForCompat(
  93. IN PNDIS_PACKET pPacket
  94. );
  95. BOOLEAN
  96. BrdgFwdBridgingNetworks();
  97. VOID
  98. BrdgFwdChangeBridging(
  99. IN BOOLEAN Bridging
  100. );
  101. // ===========================================================================
  102. //
  103. // GLOBALS
  104. //
  105. // ===========================================================================
  106. extern PHASH_TABLE gMACForwardingTable;
  107. // Thread synchronization
  108. extern KEVENT gThreadsCheckAdapters[MAXIMUM_PROCESSORS];
  109. // Whether we hang on to NIC packets when possible or not
  110. extern BOOLEAN gRetainNICPackets;
  111. // Statistics
  112. extern LARGE_INTEGER gStatTransmittedFrames;
  113. extern LARGE_INTEGER gStatTransmittedErrorFrames;
  114. extern LARGE_INTEGER gStatTransmittedBytes;
  115. extern LARGE_INTEGER gStatDirectedTransmittedFrames;
  116. extern LARGE_INTEGER gStatMulticastTransmittedFrames;
  117. extern LARGE_INTEGER gStatBroadcastTransmittedFrames;
  118. extern LARGE_INTEGER gStatDirectedTransmittedBytes;
  119. extern LARGE_INTEGER gStatMulticastTransmittedBytes;
  120. extern LARGE_INTEGER gStatBroadcastTransmittedBytes;
  121. extern LARGE_INTEGER gStatIndicatedFrames;
  122. extern LARGE_INTEGER gStatIndicatedDroppedFrames;
  123. extern LARGE_INTEGER gStatIndicatedBytes;
  124. extern LARGE_INTEGER gStatDirectedIndicatedFrames;
  125. extern LARGE_INTEGER gStatMulticastIndicatedFrames;
  126. extern LARGE_INTEGER gStatBroadcastIndicatedFrames;
  127. extern LARGE_INTEGER gStatDirectedIndicatedBytes;
  128. extern LARGE_INTEGER gStatMulticastIndicatedBytes;
  129. extern LARGE_INTEGER gStatBroadcastIndicatedBytes;
  130. extern LARGE_INTEGER gStatReceivedFrames;
  131. extern LARGE_INTEGER gStatReceivedBytes;
  132. extern LARGE_INTEGER gStatReceivedCopyFrames;
  133. extern LARGE_INTEGER gStatReceivedCopyBytes;
  134. extern LARGE_INTEGER gStatReceivedNoCopyFrames;
  135. extern LARGE_INTEGER gStatReceivedNoCopyBytes;