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.

312 lines
7.5 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. space.c
  5. Abstract:
  6. All globals and tunable variables are here.
  7. Revision History:
  8. Who When What
  9. -------- -------- ----------------------------------------------
  10. arvindm 08-08-96 Created
  11. Notes:
  12. --*/
  13. #include <precomp.h>
  14. #define _FILENUMBER 'CAPS'
  15. //
  16. // The Global Info structure is initialized in our DriverEntry.
  17. //
  18. ATMARP_GLOBALS AtmArpGlobalInfo;
  19. PATMARP_GLOBALS pAtmArpGlobalInfo = &AtmArpGlobalInfo;
  20. //
  21. // Generic NDIS protocol characteristics structure: this defines
  22. // our handler routines for various common protocol functions.
  23. // We pass this to NDIS when we register ourselves as a protocol.
  24. //
  25. NDIS_PROTOCOL_CHARACTERISTICS AtmArpProtocolCharacteristics;
  26. //
  27. // Connection Oriented Client specific NDIS characteristics structure.
  28. // This contains our handlers for Connection-Oriented functions. We pass
  29. // this structure to NDIS when we open the Q.2931 Address Family.
  30. //
  31. NDIS_CLIENT_CHARACTERISTICS AtmArpClientCharacteristics;
  32. #ifdef OLDSAP
  33. ATM_BLLI_IE AtmArpDefaultBlli =
  34. {
  35. (ULONG)BLLI_L2_LLC, // Layer2Protocol
  36. (UCHAR)0x00, // Layer2Mode
  37. (UCHAR)0x00, // Layer2WindowSize
  38. (ULONG)0x00000000, // Layer2UserSpecifiedProtocol
  39. (ULONG)BLLI_L3_ISO_TR9577, // Layer3Protocol
  40. (UCHAR)0x01, // Layer3Mode
  41. (UCHAR)0x00, // Layer3DefaultPacketSize
  42. (UCHAR)0x00, // Layer3PacketWindowSize
  43. (ULONG)0x00000000, // Layer3UserSpecifiedProtocol
  44. (ULONG)BLLI_L3_IPI_IP, // Layer3IPI,
  45. (UCHAR)0x00, // SnapID[5]
  46. (UCHAR)0x00,
  47. (UCHAR)0x00,
  48. (UCHAR)0x00,
  49. (UCHAR)0x00
  50. };
  51. #else
  52. ATM_BLLI_IE AtmArpDefaultBlli =
  53. {
  54. (ULONG)BLLI_L2_LLC, // Layer2Protocol
  55. (UCHAR)0x00, // Layer2Mode
  56. (UCHAR)0x00, // Layer2WindowSize
  57. (ULONG)0x00000000, // Layer2UserSpecifiedProtocol
  58. (ULONG)SAP_FIELD_ABSENT, // Layer3Protocol
  59. (UCHAR)0x00, // Layer3Mode
  60. (UCHAR)0x00, // Layer3DefaultPacketSize
  61. (UCHAR)0x00, // Layer3PacketWindowSize
  62. (ULONG)0x00000000, // Layer3UserSpecifiedProtocol
  63. (ULONG)0x00000000, // Layer3IPI,
  64. (UCHAR)0x00, // SnapID[5]
  65. (UCHAR)0x00,
  66. (UCHAR)0x00,
  67. (UCHAR)0x00,
  68. (UCHAR)0x00
  69. };
  70. #endif
  71. ATM_BHLI_IE AtmArpDefaultBhli =
  72. {
  73. (ULONG)SAP_FIELD_ABSENT, // HighLayerInfoType
  74. (ULONG)0x00000000, // HighLayerInfoLength
  75. (UCHAR)0x00, // HighLayerInfo[8]
  76. (UCHAR)0x00,
  77. (UCHAR)0x00,
  78. (UCHAR)0x00,
  79. (UCHAR)0x00,
  80. (UCHAR)0x00,
  81. (UCHAR)0x00,
  82. (UCHAR)0x00
  83. };
  84. AA_PKT_LLC_SNAP_HEADER AtmArpLlcSnapHeader =
  85. {
  86. (UCHAR)0xAA,
  87. (UCHAR)0xAA,
  88. (UCHAR)0x03,
  89. (UCHAR)0x00,
  90. (UCHAR)0x00,
  91. (UCHAR)0x00,
  92. (USHORT)AA_PKT_ETHERTYPE_IP_NS
  93. };
  94. #ifdef IPMCAST
  95. AA_MC_PKT_TYPE1_SHORT_HEADER AtmArpMcType1ShortHeader =
  96. {
  97. (UCHAR)MC_LLC_SNAP_LLC0,
  98. (UCHAR)MC_LLC_SNAP_LLC1,
  99. (UCHAR)MC_LLC_SNAP_LLC2,
  100. (UCHAR)MC_LLC_SNAP_OUI0,
  101. (UCHAR)MC_LLC_SNAP_OUI1,
  102. (UCHAR)MC_LLC_SNAP_OUI2,
  103. (USHORT)AA_PKT_ETHERTYPE_MC_TYPE1_NS,
  104. (USHORT)0x0, // CMI
  105. (USHORT)AA_PKT_ETHERTYPE_IP_NS
  106. };
  107. AA_MARS_PKT_FIXED_HEADER AtmArpMcMARSFixedHeader =
  108. {
  109. (UCHAR)MC_LLC_SNAP_LLC0,
  110. (UCHAR)MC_LLC_SNAP_LLC1,
  111. (UCHAR)MC_LLC_SNAP_LLC2,
  112. (UCHAR)MC_LLC_SNAP_OUI0,
  113. (UCHAR)MC_LLC_SNAP_OUI1,
  114. (UCHAR)MC_LLC_SNAP_OUI2,
  115. (USHORT)AA_PKT_ETHERTYPE_MARS_CONTROL_NS,
  116. (USHORT)AA_MC_MARS_HEADER_AFN_NS,
  117. (UCHAR)0x08, // this and the next == 0x800 (IPv4)
  118. (UCHAR)0x00,
  119. (UCHAR)0x00,
  120. (UCHAR)0x00,
  121. (UCHAR)0x00,
  122. (UCHAR)0x00,
  123. (UCHAR)0x00,
  124. (UCHAR)0x00, // hdrrsv[0]
  125. (UCHAR)0x00, // hdrrsv[1]
  126. (UCHAR)0x00, // hdrrsv[2]
  127. (USHORT)0x0000, // check-sum
  128. (USHORT)0x0000, // extensions offset
  129. (USHORT)0x0000, // Op code
  130. (UCHAR)0x00, // Source ATM Number type+len
  131. (UCHAR)0x00 // Source ATM Subaddress type+len
  132. };
  133. #endif // IPMCAST
  134. #ifdef QOS_HEURISTICS
  135. ATMARP_FLOW_INFO AtmArpDefaultFlowInfo =
  136. {
  137. (PATMARP_FLOW_INFO)NULL, // pNextFlow
  138. (PATMARP_FLOW_INFO)NULL, // pPrevFlow
  139. #ifdef GPC
  140. (PVOID)0, // VcContext
  141. (GPC_HANDLE)NULL, // CfInfoHandle
  142. {0}, // FlowInstanceName
  143. #endif // GPC
  144. (ULONG)AAF_DEF_LOWBW_SEND_THRESHOLD, // Max Send Size
  145. { // Filter Spec:
  146. (ULONG)-1, // DestinationPort
  147. },
  148. { // Flow Spec:
  149. (ULONG)AAF_DEF_LOWBW_SEND_BANDWIDTH,
  150. (ULONG)65535,
  151. (ULONG)AAF_DEF_LOWBW_RECV_BANDWIDTH,
  152. (ULONG)65535,
  153. ENCAPSULATION_TYPE_LLCSNAP,
  154. AAF_DEF_LOWBW_AGING_TIME
  155. }
  156. };
  157. #endif // QOS_HEURISTICS
  158. #ifdef GPC
  159. GPC_CLASSIFY_PACKET_HANDLER AtmArpGpcClassifyPacketHandler;
  160. GPC_GET_CFINFO_CLIENT_CONTEXT_HANDLER AtmArpGpcGetCfInfoClientContextHandler;
  161. #endif // GPC
  162. //
  163. // Timer configuration.
  164. //
  165. #define AAT_MAX_TIMER_SHORT_DURATION 60 // Seconds
  166. #define AAT_MAX_TIMER_LONG_DURATION (30*60) // Seconds
  167. #define AAT_SHORT_DURATION_TIMER_PERIOD 1 // Second
  168. #define AAT_LONG_DURATION_TIMER_PERIOD 10 // Seconds
  169. //
  170. // Max timeout value (in seconds) for each class.
  171. //
  172. ULONG AtmArpMaxTimerValue[AAT_CLASS_MAX] =
  173. {
  174. AAT_MAX_TIMER_SHORT_DURATION,
  175. AAT_MAX_TIMER_LONG_DURATION
  176. };
  177. //
  178. // Size of each timer wheel.
  179. //
  180. ULONG AtmArpTimerListSize[AAT_CLASS_MAX] =
  181. {
  182. SECONDS_TO_SHORT_TICKS(AAT_MAX_TIMER_SHORT_DURATION),
  183. SECONDS_TO_LONG_TICKS(AAT_MAX_TIMER_LONG_DURATION)
  184. };
  185. //
  186. // Interval between ticks, in seconds, for each class.
  187. //
  188. ULONG AtmArpTimerPeriod[AAT_CLASS_MAX] =
  189. {
  190. AAT_SHORT_DURATION_TIMER_PERIOD,
  191. AAT_LONG_DURATION_TIMER_PERIOD
  192. };
  193. #ifdef ATMARP_WMI
  194. ATMARP_WMI_GUID AtmArpGuidList[] = {
  195. {
  196. 0, // MyId
  197. //
  198. // GUID_QOS_TC_SUPPORTED:
  199. //
  200. {0xe40056dcL,0x40c8,0x11d1,0x2c,0x91,0x00,0xaa,0x00,0x57,0x59,0x15},
  201. 0, // Flags
  202. AtmArpWmiQueryTCSupported,
  203. AtmArpWmiSetTCSupported,
  204. AtmArpWmiEnableEventTCSupported
  205. },
  206. {
  207. 1,
  208. //
  209. // GUID_QOS_TC_INTERFACE_UP_INDICATION:
  210. //
  211. {0x0ca13af0L,0x46c4,0x11d1,0x78,0xac,0x00,0x80,0x5f,0x68,0x35,0x1e},
  212. AWGF_EVENT_ENABLED, // Flags
  213. AtmArpWmiQueryTCIfIndication,
  214. AtmArpWmiSetTCIfIndication,
  215. AtmArpWmiEnableEventTCIfIndication
  216. },
  217. {
  218. 2,
  219. //
  220. // GUID_QOS_TC_INTERFACE_DOWN_INDICATION:
  221. //
  222. {0xaf5315e4L,0xce61,0x11d1,0x7c,0x8a,0x00,0xc0,0x4f,0xc9,0xb5,0x7c},
  223. AWGF_EVENT_ENABLED, // Flags
  224. AtmArpWmiQueryTCIfIndication,
  225. AtmArpWmiSetTCIfIndication,
  226. AtmArpWmiEnableEventTCIfIndication
  227. },
  228. {
  229. 3,
  230. //
  231. // GUID_QOS_TC_INTERFACE_CHANGE_INDICATION:
  232. //
  233. {0xda76a254L,0xce61,0x11d1,0x7c,0x8a,0x00,0xc0,0x4f,0xc9,0xb5,0x7c},
  234. AWGF_EVENT_ENABLED, // Flags
  235. AtmArpWmiQueryTCIfIndication,
  236. AtmArpWmiSetTCIfIndication,
  237. AtmArpWmiEnableEventTCIfIndication
  238. }
  239. #if 0
  240. ,
  241. {
  242. 4,
  243. //
  244. // GUID_QOS_STATISTICS_BUFFER:
  245. //
  246. {0xbb2c0980L,0xe900,0x11d1,0xb0,0x7e,0x00,0x80,0xc7,0x13,0x82,0xbf},
  247. 0, // Flags
  248. AtmArpWmiQueryStatisticsBuffer,
  249. AtmArpWmiSetStatisticsBuffer,
  250. NULL
  251. }
  252. #endif // 0
  253. };
  254. ULONG AtmArpGuidCount = sizeof(AtmArpGuidList) / sizeof(ATMARP_WMI_GUID);
  255. #ifdef BACK_FILL
  256. #ifdef ATMARP_WIN98
  257. ULONG AtmArpDoBackFill = 0;
  258. #else
  259. ULONG AtmArpDoBackFill = 0;
  260. #endif
  261. ULONG AtmArpBackFillCount = 0;
  262. #endif // BACK_FILL
  263. #endif // ATMARP_WMI