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.

182 lines
5.1 KiB

  1. /*++
  2. Copyright (c) 1992-1996 Microsoft Corporation
  3. Module Name:
  4. data.c
  5. Abstract:
  6. This file contains the data declarations for the atmarp server.
  7. Author:
  8. Jameel Hyder (jameelh@microsoft.com) July 1996
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. --*/
  13. #include <precomp.h>
  14. #define _FILENUM_ FILENUM_DATA
  15. PDRIVER_OBJECT ArpSDriverObject = NULL;
  16. PDEVICE_OBJECT ArpSDeviceObject = NULL;
  17. NDIS_HANDLE ArpSProtocolHandle = NULL;
  18. NDIS_HANDLE ArpSPktPoolHandle = NULL;
  19. NDIS_HANDLE ArpSBufPoolHandle = NULL;
  20. NDIS_HANDLE MarsPktPoolHandle = NULL;
  21. NDIS_HANDLE MarsBufPoolHandle = NULL;
  22. PINTF ArpSIfList = NULL;
  23. ULONG ArpSIfListSize = 0;
  24. KSPIN_LOCK ArpSIfListLock = { 0 };
  25. KQUEUE ArpSReqQueue = {0};
  26. KQUEUE MarsReqQueue = {0};
  27. LIST_ENTRY ArpSEntryOfDeath = {0};
  28. KEVENT ArpSReqThreadEvent = {0};
  29. SLIST_HEADER ArpSPktList = {0};
  30. KSPIN_LOCK ArpSPktListLock = { 0 };
  31. UINT ArpSBuffers = NUM_ARPS_DESC;
  32. UINT MarsPackets = NUM_MARS_DESC;
  33. PVOID ArpSBufferSpace = NULL;
  34. USHORT ArpSFlushTime = FLUSH_TIME;
  35. USHORT ArpSNumEntriesInBlock[ARP_BLOCK_TYPES] =
  36. {
  37. (BLOCK_ALLOC_SIZE - sizeof(ARP_BLOCK))/(sizeof(ARP_ENTRY) + 0),
  38. (BLOCK_ALLOC_SIZE - sizeof(ARP_BLOCK))/(sizeof(ARP_ENTRY) + sizeof(ATM_ADDRESS)),
  39. (BLOCK_ALLOC_SIZE - sizeof(ARP_BLOCK))/(sizeof(GROUP_MEMBER) + 0),
  40. (BLOCK_ALLOC_SIZE - sizeof(ARP_BLOCK))/(sizeof(CLUSTER_MEMBER) + 0),
  41. (BLOCK_ALLOC_SIZE - sizeof(ARP_BLOCK))/(sizeof(CLUSTER_MEMBER) + sizeof(ATM_ADDRESS)),
  42. (BLOCK_ALLOC_SIZE - sizeof(ARP_BLOCK))/(sizeof(MARS_ENTRY) + 0)
  43. };
  44. USHORT ArpSEntrySize[ARP_BLOCK_TYPES] =
  45. {
  46. sizeof(ARP_ENTRY),
  47. sizeof(ARP_ENTRY) + sizeof(ATM_ADDRESS),
  48. sizeof(GROUP_MEMBER),
  49. sizeof(CLUSTER_MEMBER),
  50. sizeof(CLUSTER_MEMBER) + sizeof(ATM_ADDRESS),
  51. sizeof(MARS_ENTRY) + 0
  52. };
  53. BOOLEAN ArpSBlockIsPaged[ARP_BLOCK_TYPES] =
  54. {
  55. TRUE,
  56. TRUE,
  57. FALSE,
  58. FALSE,
  59. FALSE,
  60. FALSE
  61. };
  62. #ifdef OLDSAP
  63. ATM_BLLI_IE ArpSDefaultBlli =
  64. {
  65. (ULONG)BLLI_L2_LLC, // Layer2Protocol
  66. (UCHAR)0x00, // Layer2Mode
  67. (UCHAR)0x00, // Layer2WindowSize
  68. (ULONG)0x00000000, // Layer2UserSpecifiedProtocol
  69. (ULONG)BLLI_L3_ISO_TR9577, // Layer3Protocol
  70. (UCHAR)0x01, // Layer3Mode
  71. (UCHAR)0x00, // Layer3DefaultPacketSize
  72. (UCHAR)0x00, // Layer3PacketWindowSize
  73. (ULONG)0x00000000, // Layer3UserSpecifiedProtocol
  74. (ULONG)BLLI_L3_IPI_IP, // Layer3IPI,
  75. (UCHAR)0x00, // SnapID[5]
  76. (UCHAR)0x00,
  77. (UCHAR)0x00,
  78. (UCHAR)0x00,
  79. (UCHAR)0x00
  80. };
  81. #else
  82. ATM_BLLI_IE ArpSDefaultBlli =
  83. {
  84. (ULONG)BLLI_L2_LLC, // Layer2Protocol
  85. (UCHAR)0x00, // Layer2Mode
  86. (UCHAR)0x00, // Layer2WindowSize
  87. (ULONG)0x00000000, // Layer2UserSpecifiedProtocol
  88. (ULONG)SAP_FIELD_ABSENT, // Layer3Protocol
  89. (UCHAR)0x00, // Layer3Mode
  90. (UCHAR)0x00, // Layer3DefaultPacketSize
  91. (UCHAR)0x00, // Layer3PacketWindowSize
  92. (ULONG)0x00000000, // Layer3UserSpecifiedProtocol
  93. (ULONG)0x00000000, // Layer3IPI,
  94. (UCHAR)0x00, // SnapID[5]
  95. (UCHAR)0x00,
  96. (UCHAR)0x00,
  97. (UCHAR)0x00,
  98. (UCHAR)0x00
  99. };
  100. #endif // OLDSAP
  101. ATM_BHLI_IE ArpSDefaultBhli =
  102. {
  103. (ULONG)SAP_FIELD_ABSENT, // HighLayerInfoType
  104. (ULONG)0x00000000, // HighLayerInfoLength
  105. (UCHAR)0x00, // HighLayerInfo[8]
  106. (UCHAR)0x00,
  107. (UCHAR)0x00,
  108. (UCHAR)0x00,
  109. (UCHAR)0x00,
  110. (UCHAR)0x00,
  111. (UCHAR)0x00,
  112. (UCHAR)0x00
  113. };
  114. LLC_SNAP_HDR ArpSLlcSnapHdr = { { 0xAA, 0xAA, 0x03 }, { 0x00, 0x00, 0x00 }, { 0x0608 } };
  115. LLC_SNAP_HDR MarsCntrlLlcSnapHdr = { { 0xAA, 0xAA, 0x03 }, { 0x00, 0x00, 0x5E }, { 0x0300 } };
  116. LLC_SNAP_HDR MarsData1LlcSnapHdr = { { 0xAA, 0xAA, 0x03 }, { 0x00, 0x00, 0x5E }, { 0x0100 } };
  117. LLC_SNAP_HDR MarsData2LlcSnapHdr = { { 0xAA, 0xAA, 0x03 }, { 0x00, 0x00, 0x5E }, { 0x0400 } };
  118. MARS_HEADER MarsCntrlHdr =
  119. { { { 0xAA, 0xAA, 0x03 } , { 0x00, 0x00, 0x5E } , 0x0300 },
  120. // { 0x00, 0x0f }, // HwType or AFN
  121. 0x0f00,
  122. // { 0x08, 0x00 }, // Pro.Type
  123. 0x0008,
  124. { 0x00, 0x00, 0x00, 0x00, 0x00 }, // ProtocolSnap[]
  125. { 0x00, 0x00, 0x00 }, // Reserved[]
  126. // { 0x00, 0x00 }, // Checksum
  127. 0x0000,
  128. // { 0x00, 0x00 }, // Extension offset
  129. 0x0000,
  130. // { 0x00, 0x00 }, // OpCode
  131. 0x0000,
  132. 0x00, // SrcAddressTL
  133. 0x00 // SrcSubAddrTL
  134. };
  135. MARS_FLOW_SPEC DefaultCCFlowSpec =
  136. {
  137. DEFAULT_SEND_BANDWIDTH,
  138. DEFAULT_MAX_PACKET_SIZE,
  139. 0, // ReceiveBandwidth for PMP is zero
  140. 0, // ReceiveMaxSize for PMP is zero
  141. SERVICETYPE_BESTEFFORT
  142. };
  143. MARS_TLV_MULTI_IS_MCS MultiIsMcsTLV =
  144. {
  145. MARS_TLVT_MULTI_IS_MCS,
  146. 0x0000 // TLV variable part Length
  147. };
  148. MARS_TLV_NULL NullTLV =
  149. {
  150. 0x0000,
  151. 0x0000
  152. };
  153. #if DBG
  154. ULONG ArpSDebugLevel = DBG_LEVEL_ERROR;
  155. ULONG MarsDebugLevel = DBG_LEVEL_ERROR;
  156. #endif