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.

437 lines
14 KiB

  1. /*++ BUILD Version: 0000 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ndiswan.h
  5. Abstract:
  6. Main header file for the wan wrapper
  7. Author:
  8. Thomas J. Dimitri (TommyD) 20-Feb-1994
  9. Revision History:
  10. --*/
  11. #ifndef _NDIS_WAN_
  12. #define _NDIS_WAN_
  13. //
  14. // Begin definitions for WANs
  15. //
  16. //
  17. // Bit field set int he Reserved field for
  18. // NdisRegisterMiniport or passed in NdisRegisterSpecial
  19. //
  20. #define NDIS_USE_WAN_WRAPPER 0x00000001
  21. #define NDIS_STATUS_TAPI_INDICATION ((NDIS_STATUS)0x40010080L)
  22. //
  23. // NDIS WAN Framing bits
  24. //
  25. #define RAS_FRAMING 0x00000001
  26. #define RAS_COMPRESSION 0x00000002
  27. #define ARAP_V1_FRAMING 0x00000004
  28. #define ARAP_V2_FRAMING 0x00000008
  29. #define ARAP_FRAMING (ARAP_V1_FRAMING | ARAP_V2_FRAMING)
  30. #define PPP_MULTILINK_FRAMING 0x00000010
  31. #define PPP_SHORT_SEQUENCE_HDR_FORMAT 0x00000020
  32. #define PPP_MC_MULTILINK_FRAMING 0x00000040
  33. #define PPP_FRAMING 0x00000100
  34. #define PPP_COMPRESS_ADDRESS_CONTROL 0x00000200
  35. #define PPP_COMPRESS_PROTOCOL_FIELD 0x00000400
  36. #define PPP_ACCM_SUPPORTED 0x00000800
  37. #define SLIP_FRAMING 0x00001000
  38. #define SLIP_VJ_COMPRESSION 0x00002000
  39. #define SLIP_VJ_AUTODETECT 0x00004000
  40. #define MEDIA_NRZ_ENCODING 0x00010000
  41. #define MEDIA_NRZI_ENCODING 0x00020000
  42. #define MEDIA_NLPID 0x00040000
  43. #define RFC_1356_FRAMING 0x00100000
  44. #define RFC_1483_FRAMING 0x00200000
  45. #define RFC_1490_FRAMING 0x00400000
  46. #define LLC_ENCAPSULATION 0x00800000
  47. #define SHIVA_FRAMING 0x01000000
  48. #define NBF_PRESERVE_MAC_ADDRESS 0x01000000
  49. #ifndef _WAN50_
  50. #define PASS_THROUGH_MODE 0x10000000
  51. #define RAW_PASS_THROUGH_MODE 0x20000000
  52. #endif
  53. #define TAPI_PROVIDER 0x80000000
  54. //
  55. // NDIS WAN Information structures used
  56. // by NDIS 3.1 Wan Miniport drivers
  57. //
  58. typedef struct _NDIS_WAN_INFO
  59. {
  60. OUT ULONG MaxFrameSize;
  61. OUT ULONG MaxTransmit;
  62. OUT ULONG HeaderPadding;
  63. OUT ULONG TailPadding;
  64. OUT ULONG Endpoints;
  65. OUT UINT MemoryFlags;
  66. OUT NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress;
  67. OUT ULONG FramingBits;
  68. OUT ULONG DesiredACCM;
  69. } NDIS_WAN_INFO, *PNDIS_WAN_INFO;
  70. typedef struct _NDIS_WAN_SET_LINK_INFO
  71. {
  72. IN NDIS_HANDLE NdisLinkHandle;
  73. IN ULONG MaxSendFrameSize;
  74. IN ULONG MaxRecvFrameSize;
  75. ULONG HeaderPadding;
  76. ULONG TailPadding;
  77. IN ULONG SendFramingBits;
  78. IN ULONG RecvFramingBits;
  79. IN ULONG SendCompressionBits;
  80. IN ULONG RecvCompressionBits;
  81. IN ULONG SendACCM;
  82. IN ULONG RecvACCM;
  83. } NDIS_WAN_SET_LINK_INFO, *PNDIS_WAN_SET_LINK_INFO;
  84. typedef struct _NDIS_WAN_GET_LINK_INFO {
  85. IN NDIS_HANDLE NdisLinkHandle;
  86. OUT ULONG MaxSendFrameSize;
  87. OUT ULONG MaxRecvFrameSize;
  88. OUT ULONG HeaderPadding;
  89. OUT ULONG TailPadding;
  90. OUT ULONG SendFramingBits;
  91. OUT ULONG RecvFramingBits;
  92. OUT ULONG SendCompressionBits;
  93. OUT ULONG RecvCompressionBits;
  94. OUT ULONG SendACCM;
  95. OUT ULONG RecvACCM;
  96. } NDIS_WAN_GET_LINK_INFO, *PNDIS_WAN_GET_LINK_INFO;
  97. //
  98. // NDIS WAN Bridging Options
  99. //
  100. #define BRIDGING_FLAG_LANFCS 0x00000001
  101. #define BRIDGING_FLAG_LANID 0x00000002
  102. #define BRIDGING_FLAG_PADDING 0x00000004
  103. //
  104. // NDIS WAN Bridging Capabilities
  105. //
  106. #define BRIDGING_TINYGRAM 0x00000001
  107. #define BRIDGING_LANID 0x00000002
  108. #define BRIDGING_NO_SPANNING_TREE 0x00000004
  109. #define BRIDGING_8021D_SPANNING_TREE 0x00000008
  110. #define BRIDGING_8021G_SPANNING_TREE 0x00000010
  111. #define BRIDGING_SOURCE_ROUTING 0x00000020
  112. #define BRIDGING_DEC_LANBRIDGE 0x00000040
  113. //
  114. // NDIS WAN Bridging Type
  115. //
  116. #define BRIDGING_TYPE_RESERVED 0x00000001
  117. #define BRIDGING_TYPE_8023_CANON 0x00000002
  118. #define BRIDGING_TYPE_8024_NO_CANON 0x00000004
  119. #define BRIDGING_TYPE_8025_NO_CANON 0x00000008
  120. #define BRIDGING_TYPE_FDDI_NO_CANON 0x00000010
  121. #define BRIDGING_TYPE_8024_CANON 0x00000400
  122. #define BRIDGING_TYPE_8025_CANON 0x00000800
  123. #define BRIDGING_TYPE_FDDI_CANON 0x00001000
  124. typedef struct _NDIS_WAN_GET_BRIDGE_INFO
  125. {
  126. IN NDIS_HANDLE NdisLinkHandle;
  127. OUT USHORT LanSegmentNumber;
  128. OUT UCHAR BridgeNumber;
  129. OUT UCHAR BridgingOptions;
  130. OUT ULONG BridgingCapabilities;
  131. OUT UCHAR BridgingType;
  132. OUT UCHAR MacBytes[6];
  133. } NDIS_WAN_GET_BRIDGE_INFO, *PNDIS_WAN_GET_BRIDGE_INFO;
  134. typedef struct _NDIS_WAN_SET_BRIDGE_INFO
  135. {
  136. IN NDIS_HANDLE NdisLinkHandle;
  137. IN USHORT LanSegmentNumber;
  138. IN UCHAR BridgeNumber;
  139. IN UCHAR BridgingOptions;
  140. IN ULONG BridgingCapabilities;
  141. IN UCHAR BridgingType;
  142. IN UCHAR MacBytes[6];
  143. } NDIS_WAN_SET_BRIDGE_INFO, *PNDIS_WAN_SET_BRIDGE_INFO;
  144. //
  145. // NDIS WAN Compression Information
  146. //
  147. //
  148. // Define MSCompType bit field, 0 disables all
  149. //
  150. #define NDISWAN_COMPRESSION 0x00000001
  151. #define NDISWAN_ENCRYPTION 0x00000010
  152. #define NDISWAN_40_ENCRYPTION 0x00000020
  153. #define NDISWAN_128_ENCRYPTION 0x00000040
  154. #define NDISWAN_56_ENCRYPTION 0x00000080
  155. #define NDISWAN_HISTORY_LESS 0x01000000
  156. //
  157. // Define CompType codes
  158. //
  159. #define COMPTYPE_OUI 0
  160. #define COMPTYPE_NT31RAS 254
  161. #define COMPTYPE_NONE 255
  162. typedef struct _NDIS_WAN_COMPRESS_INFO
  163. {
  164. UCHAR SessionKey[8];
  165. ULONG MSCompType;
  166. // Fields above indicate NDISWAN capabilities.
  167. // Fields below indicate MAC-specific capabilities.
  168. UCHAR CompType;
  169. USHORT CompLength;
  170. union
  171. {
  172. struct
  173. {
  174. UCHAR CompOUI[3];
  175. UCHAR CompSubType;
  176. UCHAR CompValues[32];
  177. } Proprietary;
  178. struct
  179. {
  180. UCHAR CompValues[32];
  181. } Public;
  182. };
  183. } NDIS_WAN_COMPRESS_INFO;
  184. typedef NDIS_WAN_COMPRESS_INFO UNALIGNED *PNDIS_WAN_COMPRESS_INFO;
  185. typedef struct _NDIS_WAN_GET_COMP_INFO
  186. {
  187. IN NDIS_HANDLE NdisLinkHandle;
  188. OUT NDIS_WAN_COMPRESS_INFO SendCapabilities;
  189. OUT NDIS_WAN_COMPRESS_INFO RecvCapabilities;
  190. } NDIS_WAN_GET_COMP_INFO, *PNDIS_WAN_GET_COMP_INFO;
  191. typedef struct _NDIS_WAN_SET_COMP_INFO
  192. {
  193. IN NDIS_HANDLE NdisLinkHandle;
  194. IN NDIS_WAN_COMPRESS_INFO SendCapabilities;
  195. IN NDIS_WAN_COMPRESS_INFO RecvCapabilities;
  196. } NDIS_WAN_SET_COMP_INFO, *PNDIS_WAN_SET_COMP_INFO;
  197. //
  198. // NDIS WAN Statistics Information
  199. //
  200. typedef struct _NDIS_WAN_GET_STATS_INFO
  201. {
  202. IN NDIS_HANDLE NdisLinkHandle;
  203. OUT ULONG BytesSent;
  204. OUT ULONG BytesRcvd;
  205. OUT ULONG FramesSent;
  206. OUT ULONG FramesRcvd;
  207. OUT ULONG CRCErrors; // Serial-like info only
  208. OUT ULONG TimeoutErrors; // Serial-like info only
  209. OUT ULONG AlignmentErrors; // Serial-like info only
  210. OUT ULONG SerialOverrunErrors; // Serial-like info only
  211. OUT ULONG FramingErrors; // Serial-like info only
  212. OUT ULONG BufferOverrunErrors; // Serial-like info only
  213. OUT ULONG BytesTransmittedUncompressed; // Compression info only
  214. OUT ULONG BytesReceivedUncompressed; // Compression info only
  215. OUT ULONG BytesTransmittedCompressed; // Compression info only
  216. OUT ULONG BytesReceivedCompressed; // Compression info only
  217. } NDIS_WAN_GET_STATS_INFO, *PNDIS_WAN_GET_STATS_INFO;
  218. #define NdisMWanInitializeWrapper(NdisWrapperHandle, \
  219. SystemSpecific1, \
  220. SystemSpecific2, \
  221. SystemSpecific3) \
  222. { \
  223. NdisMInitializeWrapper(NdisWrapperHandle, \
  224. SystemSpecific1, \
  225. SystemSpecific2, \
  226. SystemSpecific3); \
  227. }
  228. typedef struct _NDIS_MAC_LINE_UP
  229. {
  230. IN ULONG LinkSpeed;
  231. IN NDIS_WAN_QUALITY Quality;
  232. IN USHORT SendWindow;
  233. IN NDIS_HANDLE ConnectionWrapperID;
  234. IN NDIS_HANDLE NdisLinkHandle;
  235. OUT NDIS_HANDLE NdisLinkContext;
  236. } NDIS_MAC_LINE_UP, *PNDIS_MAC_LINE_UP;
  237. typedef struct _NDIS_MAC_LINE_DOWN
  238. {
  239. IN NDIS_HANDLE NdisLinkContext;
  240. } NDIS_MAC_LINE_DOWN, *PNDIS_MAC_LINE_DOWN;
  241. //
  242. // These are the error values that can be indicated by the driver.
  243. // This bit field is set when calling NdisIndicateStatus.
  244. //
  245. #define WAN_ERROR_CRC ((ULONG)0x00000001)
  246. #define WAN_ERROR_FRAMING ((ULONG)0x00000002)
  247. #define WAN_ERROR_HARDWAREOVERRUN ((ULONG)0x00000004)
  248. #define WAN_ERROR_BUFFEROVERRUN ((ULONG)0x00000008)
  249. #define WAN_ERROR_TIMEOUT ((ULONG)0x00000010)
  250. #define WAN_ERROR_ALIGNMENT ((ULONG)0x00000020)
  251. typedef struct _NDIS_MAC_FRAGMENT
  252. {
  253. IN NDIS_HANDLE NdisLinkContext;
  254. IN ULONG Errors;
  255. } NDIS_MAC_FRAGMENT, *PNDIS_MAC_FRAGMENT;
  256. //
  257. // NDIS WAN Information structures used
  258. // by NDIS 5.0 Miniport drivers
  259. //
  260. //
  261. // Defines for the individual fields are the
  262. // same as for NDIS 3.x/4.x Wan miniports.
  263. //
  264. // See the DDK.
  265. //
  266. //
  267. // Information that applies to all VC's on
  268. // this adapter.
  269. //
  270. // OID: OID_WAN_CO_GET_INFO
  271. //
  272. typedef struct _NDIS_WAN_CO_INFO {
  273. OUT ULONG MaxFrameSize;
  274. OUT ULONG MaxSendWindow;
  275. OUT ULONG FramingBits;
  276. OUT ULONG DesiredACCM;
  277. } NDIS_WAN_CO_INFO, *PNDIS_WAN_CO_INFO;
  278. //
  279. // Set VC specific PPP framing information.
  280. //
  281. // OID: OID_WAN_CO_SET_LINK_INFO
  282. //
  283. typedef struct _NDIS_WAN_CO_SET_LINK_INFO {
  284. IN ULONG MaxSendFrameSize;
  285. IN ULONG MaxRecvFrameSize;
  286. IN ULONG SendFramingBits;
  287. IN ULONG RecvFramingBits;
  288. IN ULONG SendCompressionBits;
  289. IN ULONG RecvCompressionBits;
  290. IN ULONG SendACCM;
  291. IN ULONG RecvACCM;
  292. } NDIS_WAN_CO_SET_LINK_INFO, *PNDIS_WAN_CO_SET_LINK_INFO;
  293. //
  294. // Get VC specific PPP framing information.
  295. //
  296. // OID: OID_WAN_CO_GET_LINK_INFO
  297. //
  298. typedef struct _NDIS_WAN_CO_GET_LINK_INFO {
  299. OUT ULONG MaxSendFrameSize;
  300. OUT ULONG MaxRecvFrameSize;
  301. OUT ULONG SendFramingBits;
  302. OUT ULONG RecvFramingBits;
  303. OUT ULONG SendCompressionBits;
  304. OUT ULONG RecvCompressionBits;
  305. OUT ULONG SendACCM;
  306. OUT ULONG RecvACCM;
  307. } NDIS_WAN_CO_GET_LINK_INFO, *PNDIS_WAN_CO_GET_LINK_INFO;
  308. //
  309. // Get VC specific PPP compression information
  310. //
  311. // OID: OID_WAN_CO_GET_COMP_INFO
  312. //
  313. typedef struct _NDIS_WAN_CO_GET_COMP_INFO {
  314. OUT NDIS_WAN_COMPRESS_INFO SendCapabilities;
  315. OUT NDIS_WAN_COMPRESS_INFO RecvCapabilities;
  316. } NDIS_WAN_CO_GET_COMP_INFO, *PNDIS_WAN_CO_GET_COMP_INFO;
  317. //
  318. // Set VC specific PPP compression information
  319. //
  320. // OID: OID_WAN_CO_SET_COMP_INFO
  321. //
  322. typedef struct _NDIS_WAN_CO_SET_COMP_INFO {
  323. IN NDIS_WAN_COMPRESS_INFO SendCapabilities;
  324. IN NDIS_WAN_COMPRESS_INFO RecvCapabilities;
  325. } NDIS_WAN_CO_SET_COMP_INFO, *PNDIS_WAN_CO_SET_COMP_INFO;
  326. //
  327. // Get VC specific statistics
  328. //
  329. // OID: OID_WAN_CO_GET_STATS_INFO
  330. //
  331. typedef struct _NDIS_WAN_CO_GET_STATS_INFO {
  332. OUT ULONG BytesSent;
  333. OUT ULONG BytesRcvd;
  334. OUT ULONG FramesSent;
  335. OUT ULONG FramesRcvd;
  336. OUT ULONG CRCErrors; // Serial-like info only
  337. OUT ULONG TimeoutErrors; // Serial-like info only
  338. OUT ULONG AlignmentErrors; // Serial-like info only
  339. OUT ULONG SerialOverrunErrors; // Serial-like info only
  340. OUT ULONG FramingErrors; // Serial-like info only
  341. OUT ULONG BufferOverrunErrors; // Serial-like info only
  342. OUT ULONG BytesTransmittedUncompressed; // Compression info only
  343. OUT ULONG BytesReceivedUncompressed; // Compression info only
  344. OUT ULONG BytesTransmittedCompressed; // Compression info only
  345. OUT ULONG BytesReceivedCompressed; // Compression info only
  346. } NDIS_WAN_CO_GET_STATS_INFO, *PNDIS_WAN_CO_GET_STATS_INFO;
  347. //
  348. // Used to notify NdisWan of Errors. See error
  349. // bit mask in ndiswan.h
  350. //
  351. // NDIS_STATUS: NDIS_STATUS_WAN_CO_FRAGMENT
  352. //
  353. typedef struct _NDIS_WAN_CO_FRAGMENT {
  354. IN ULONG Errors;
  355. } NDIS_WAN_CO_FRAGMENT, *PNDIS_WAN_CO_FRAGMENT;
  356. //
  357. // Used to notify NdisWan of changes in link speed and
  358. // send window. Can be given at any time. NdisWan will honor
  359. // any send window (even zero). NdisWan will default zero
  360. // TransmitSpeed/ReceiveSpeed settings to 28.8Kbs.
  361. //
  362. // NDIS_STATUS: NDIS_STATUS_WAN_CO_LINKPARAMS
  363. //
  364. typedef struct _WAN_CO_LINKPARAMS {
  365. ULONG TransmitSpeed; // Transmit speed of the VC in Bytes/sec
  366. ULONG ReceiveSpeed; // Receive speed of the VC in Bytes/sec
  367. ULONG SendWindow; // Current send window for the VC
  368. } WAN_CO_LINKPARAMS, *PWAN_CO_LINKPARAMS;
  369. #endif // _NDIS_WAN