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.

792 lines
26 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. Wanpub.h
  5. Abstract:
  6. This file contains all public data structures and defines used
  7. by NdisWan. It defines the Ioctl interface to NdisWan as well
  8. as the LineUp/LineDown interface between NdisWan and the transports.
  9. Author:
  10. Tony Bell (TonyBe) June 06, 1995
  11. Environment:
  12. Kernel Mode
  13. Revision History:
  14. TonyBe 06/06/95 Created
  15. --*/
  16. #ifndef _NDISWAN_PUB_
  17. #define _NDISWAN_PUB_
  18. #ifndef NTSTATUS
  19. typedef LONG NTSTATUS;
  20. #endif
  21. #ifndef NDIS_HANDLE
  22. typedef PVOID NDIS_HANDLE, *PNDIS_HANDLE;
  23. #endif
  24. #ifndef NDIS_STRING
  25. typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING;
  26. #endif
  27. #ifndef NDIS_WAN_QUALITY
  28. #endif
  29. #include <ntddndis.h>
  30. //
  31. // Handle types that ndiswan expects
  32. //
  33. #define LINKHANDLE 0xABB0
  34. #define BUNDLEHANDLE 0xABB1
  35. #define CANCELEDHANDLE 0xABB2
  36. //
  37. // Threshold event types
  38. //
  39. #define UPPER_THRESHOLD 0x00000001
  40. #define LOWER_THRESHOLD 0x00000002
  41. //
  42. // Threshold event data types
  43. //
  44. #define TRANSMIT_DATA 0x00000001
  45. #define RECEIVE_DATA 0x00000002
  46. //
  47. // Unroute a bundle
  48. //
  49. #define PROTOCOL_UNROUTE 0xFFFF
  50. //
  51. // Get Bundle's Idle time
  52. //
  53. #define BUNDLE_IDLE_TIME 0xFFFF
  54. #define MAX_PPP_HEADER 8
  55. #define MAX_NAME_LENGTH 256
  56. //
  57. // NDISWAN_IO_PACKET flags
  58. //
  59. #define PACKET_IS_DIRECT 0x0001
  60. #define PACKET_IS_BROADCAST 0x0002
  61. #define PACKET_IS_MULTICAST 0x0004
  62. //
  63. // Maximum number of protocols we can support
  64. //
  65. #define MAX_PROTOCOLS 32
  66. //
  67. // Ioctl function codes should be kept contiguous. Dispatch
  68. // table is in io.c. If a new function is added the dispatch
  69. // table has to be updated!
  70. //
  71. #define FUNC_MAP_CONNECTION_ID 0
  72. #define FUNC_GET_BUNDLE_HANDLE 1
  73. #define FUNC_SET_FRIENDLY_NAME 2
  74. #define FUNC_ROUTE 3
  75. #define FUNC_ADD_LINK_TO_BUNDLE 4
  76. #define FUNC_ENUM_LINKS_IN_BUNDLE 5
  77. #define FUNC_SET_PROTOCOL_PRIORITY 6
  78. #define FUNC_SET_BANDWIDTH_ON_DEMAND 7
  79. #define FUNC_SET_THRESHOLD_EVENT 8
  80. #define FUNC_FLUSH_THRESHOLD_EVENTS 9
  81. #define FUNC_SEND_PACKET 10
  82. #define FUNC_RECEIVE_PACKET 11
  83. #define FUNC_FLUSH_RECEIVE_PACKETS 12
  84. #define FUNC_GET_STATS 13
  85. #define FUNC_SET_LINK_INFO 14
  86. #define FUNC_GET_LINK_INFO 15
  87. #define FUNC_SET_COMPRESSION_INFO 16
  88. #define FUNC_GET_COMPRESSION_INFO 17
  89. #define FUNC_SET_BRIDGE_INFO 18
  90. #define FUNC_GET_BRIDGE_INFO 19
  91. #define FUNC_SET_VJ_INFO 20
  92. #define FUNC_GET_VJ_INFO 21
  93. #define FUNC_SET_CIPX_INFO 22
  94. #define FUNC_GET_CIPX_INFO 23
  95. #define FUNC_SET_ENCRYPTION_INFO 24
  96. #define FUNC_GET_ENCRYPTION_INFO 25
  97. #define FUNC_SET_DEBUG_INFO 26
  98. #define FUNC_ENUM_ACTIVE_BUNDLES 27
  99. #define FUNC_GET_NDISWANCB 28
  100. #define FUNC_GET_MINIPORTCB 29
  101. #define FUNC_GET_OPENCB 30
  102. #define FUNC_GET_BANDWIDTH_UTILIZATION 31
  103. #define FUNC_ENUM_PROTOCOL_UTILIZATION 32
  104. #define FUNC_ENUM_MINIPORTCB 33
  105. #define FUNC_ENUM_OPENCB 34
  106. #define FUNC_GET_WAN_INFO 35
  107. #define FUNC_GET_IDLE_TIME 36
  108. #define FUNC_UNROUTE 37
  109. #define FUNC_GET_DRIVER_INFO 38
  110. #define FUNC_SET_PROTOCOL_EVENT 39
  111. #define FUNC_GET_PROTOCOL_EVENT 40
  112. #define FUNC_FLUSH_PROTOCOL_EVENT 41
  113. #define FUNC_GET_PROTOCOL_INFO 42
  114. #define FUNC_SET_HIBERNATE_EVENT 43
  115. #define FUNC_FLUSH_HIBERNATE_EVENT 44
  116. #define FUNC_GET_BUNDLE_INFO 45
  117. #define FUNC_UNMAP_CONNECTION_ID 46
  118. #ifdef NT // NT Specific stuff
  119. #ifdef MY_DEVICE_OBJECT
  120. #define FILE_DEVICE_NDISWAN 0x030
  121. #define NDISWAN_CTL_CODE(_Function) CTL_CODE(FILE_DEVICE_NDISWAN, _Function, METHOD_BUFFERED, FILE_ANY_ACCESS)
  122. #else
  123. #define NDISWAN_CTL_CODE(_Function) CTL_CODE(FILE_DEVICE_NETWORK, _Function, METHOD_BUFFERED, FILE_ANY_ACCESS)
  124. #endif
  125. #define IOCTL_NDISWAN_MAP_CONNECTION_ID NDISWAN_CTL_CODE(FUNC_MAP_CONNECTION_ID )
  126. #define IOCTL_NDISWAN_GET_BUNDLE_HANDLE NDISWAN_CTL_CODE(FUNC_GET_BUNDLE_HANDLE )
  127. #define IOCTL_NDISWAN_SET_FRIENDLY_NAME NDISWAN_CTL_CODE(FUNC_SET_FRIENDLY_NAME )
  128. #define IOCTL_NDISWAN_ROUTE NDISWAN_CTL_CODE(FUNC_ROUTE )
  129. #define IOCTL_NDISWAN_ADD_LINK_TO_BUNDLE NDISWAN_CTL_CODE(FUNC_ADD_LINK_TO_BUNDLE )
  130. #define IOCTL_NDISWAN_ENUM_LINKS_IN_BUNDLE NDISWAN_CTL_CODE(FUNC_ENUM_LINKS_IN_BUNDLE )
  131. #define IOCTL_NDISWAN_SET_PROTOCOL_PRIORITY NDISWAN_CTL_CODE(FUNC_SET_PROTOCOL_PRIORITY )
  132. #define IOCTL_NDISWAN_SET_BANDWIDTH_ON_DEMAND NDISWAN_CTL_CODE(FUNC_SET_BANDWIDTH_ON_DEMAND)
  133. #define IOCTL_NDISWAN_SET_THRESHOLD_EVENT NDISWAN_CTL_CODE(FUNC_SET_THRESHOLD_EVENT )
  134. #define IOCTL_NDISWAN_FLUSH_THRESHOLD_EVENTS NDISWAN_CTL_CODE(FUNC_FLUSH_THRESHOLD_EVENTS)
  135. #define IOCTL_NDISWAN_SEND_PACKET NDISWAN_CTL_CODE(FUNC_SEND_PACKET )
  136. #define IOCTL_NDISWAN_RECEIVE_PACKET NDISWAN_CTL_CODE(FUNC_RECEIVE_PACKET )
  137. #define IOCTL_NDISWAN_FLUSH_RECEIVE_PACKETS NDISWAN_CTL_CODE(FUNC_FLUSH_RECEIVE_PACKETS )
  138. #define IOCTL_NDISWAN_GET_STATS NDISWAN_CTL_CODE(FUNC_GET_STATS )
  139. #define IOCTL_NDISWAN_SET_LINK_INFO NDISWAN_CTL_CODE(FUNC_SET_LINK_INFO )
  140. #define IOCTL_NDISWAN_GET_LINK_INFO NDISWAN_CTL_CODE(FUNC_GET_LINK_INFO )
  141. #define IOCTL_NDISWAN_SET_COMPRESSION_INFO NDISWAN_CTL_CODE(FUNC_SET_COMPRESSION_INFO )
  142. #define IOCTL_NDISWAN_GET_COMPRESSION_INFO NDISWAN_CTL_CODE(FUNC_GET_COMPRESSION_INFO )
  143. #define IOCTL_NDISWAN_SET_BRIDGE_INFO NDISWAN_CTL_CODE(FUNC_SET_BRIDGE_INFO )
  144. #define IOCTL_NDISWAN_GET_BRIDGE_INFO NDISWAN_CTL_CODE(FUNC_GET_BRIDGE_INFO )
  145. #define IOCTL_NDISWAN_SET_VJ_INFO NDISWAN_CTL_CODE(FUNC_SET_VJ_INFO )
  146. #define IOCTL_NDISWAN_GET_VJ_INFO NDISWAN_CTL_CODE(FUNC_GET_VJ_INFO )
  147. #define IOCTL_NDISWAN_SET_CIPX_INFO NDISWAN_CTL_CODE(FUNC_SET_CIPX_INFO )
  148. #define IOCTL_NDISWAN_GET_CIPX_INFO NDISWAN_CTL_CODE(FUNC_GET_CIPX_INFO )
  149. #define IOCTL_NDISWAN_SET_ENCRYPTION_INFO NDISWAN_CTL_CODE(FUNC_SET_ENCRYPTION_INFO )
  150. #define IOCTL_NDISWAN_GET_ENCRYPTION_INFO NDISWAN_CTL_CODE(FUNC_GET_ENCRYPTION_INFO )
  151. #define IOCTL_NDISWAN_SET_DEBUG_INFO NDISWAN_CTL_CODE(FUNC_SET_DEBUG_INFO )
  152. #define IOCTL_NDISWAN_ENUM_ACTIVE_BUNDLES NDISWAN_CTL_CODE(FUNC_ENUM_ACTIVE_BUNDLES )
  153. #define IOCTL_NDISWAN_GET_NDISWANCB NDISWAN_CTL_CODE(FUNC_GET_NDISWANCB )
  154. #define IOCTL_NDISWAN_GET_MINIPORTCB NDISWAN_CTL_CODE(FUNC_GET_MINIPORTCB )
  155. #define IOCTL_NDISWAN_GET_OPENCB NDISWAN_CTL_CODE(FUNC_GET_OPENCB )
  156. #define IOCTL_NDISWAN_GET_BANDWIDTH_UTILIZATION NDISWAN_CTL_CODE(FUNC_GET_BANDWIDTH_UTILIZATION)
  157. #define IOCTL_NDISWAN_ENUM_PROTOCOL_UTILIZATION NDISWAN_CTL_CODE(FUNC_ENUM_PROTOCOL_UTILIZATION)
  158. #define IOCTL_NDISWAN_ENUM_MINIPORTCB NDISWAN_CTL_CODE(FUNC_ENUM_MINIPORTCB )
  159. #define IOCTL_NDISWAN_ENUM_OPENCB NDISWAN_CTL_CODE(FUNC_ENUM_OPENCB )
  160. #define IOCTL_NDISWAN_GET_WAN_INFO NDISWAN_CTL_CODE(FUNC_GET_WAN_INFO )
  161. #define IOCTL_NDISWAN_GET_IDLE_TIME NDISWAN_CTL_CODE(FUNC_GET_IDLE_TIME )
  162. #define IOCTL_NDISWAN_UNROUTE NDISWAN_CTL_CODE(FUNC_UNROUTE )
  163. #define IOCTL_NDISWAN_GET_DRIVER_INFO NDISWAN_CTL_CODE(FUNC_GET_DRIVER_INFO )
  164. #define IOCTL_NDISWAN_SET_PROTOCOL_EVENT NDISWAN_CTL_CODE(FUNC_SET_PROTOCOL_EVENT )
  165. #define IOCTL_NDISWAN_GET_PROTOCOL_EVENT NDISWAN_CTL_CODE(FUNC_GET_PROTOCOL_EVENT )
  166. #define IOCTL_NDISWAN_FLUSH_PROTOCOL_EVENT NDISWAN_CTL_CODE(FUNC_FLUSH_PROTOCOL_EVENT )
  167. #define IOCTL_NDISWAN_GET_PROTOCOL_INFO NDISWAN_CTL_CODE(FUNC_GET_PROTOCOL_INFO )
  168. #define IOCTL_NDISWAN_SET_HIBERNATE_EVENT NDISWAN_CTL_CODE(FUNC_SET_HIBERNATE_EVENT )
  169. #define IOCTL_NDISWAN_FLUSH_HIBERNATE_EVENT NDISWAN_CTL_CODE(FUNC_FLUSH_HIBERNATE_EVENT )
  170. #define IOCTL_NDISWAN_GET_BUNDLE_INFO NDISWAN_CTL_CODE(FUNC_GET_BUNDLE_INFO )
  171. #define IOCTL_NDISWAN_UNMAP_CONNECTION_ID NDISWAN_CTL_CODE(FUNC_UNMAP_CONNECTION_ID )
  172. #endif // end NT
  173. //
  174. // NdisWan error messages
  175. //
  176. #define NDISWAN_ERROR_BASE 600
  177. #define NDISWAN_ERROR_INVALID_HANDLE NDISWAN_ERROR_BASE + 1
  178. #define NDISWAN_ERROR_ALREADY_ROUTED NDISWAN_ERROR_BASE + 2
  179. #define NDISWAN_ERROR_NO_ROUTE NDISWAN_ERROR_BASE + 3
  180. #define NDISWAN_ERROR_INVALID_HANDLE_TYPE NDISWAN_ERROR_BASE + 4
  181. #define NDISWAN_ERROR_INVALID_ADDRESS NDISWAN_ERROR_BASE + 5
  182. #define NDISWAN_ERROR_NOT_ROUTED NDISWAN_ERROR_BASE + 6
  183. //
  184. // Structure used to store wan statistics
  185. //
  186. typedef struct _WAN_STATS {
  187. ULONG BytesTransmitted;
  188. ULONG BytesReceived;
  189. ULONG FramesTransmitted;
  190. ULONG FramesReceived;
  191. ULONG CRCErrors;
  192. ULONG TimeoutErrors;
  193. ULONG AlignmentErrors;
  194. ULONG SerialOverrunErrors;
  195. ULONG FramingErrors;
  196. ULONG BufferOverrunErrors;
  197. ULONG BytesTransmittedUncompressed;
  198. ULONG BytesReceivedUncompressed;
  199. ULONG BytesTransmittedCompressed;
  200. ULONG BytesReceivedCompressed;
  201. } WAN_STATS, *PWAN_STATS;
  202. //
  203. // Structure used to get and set WAN Link Information
  204. // Needs to be kept in sync with NDIS_WAN_SET_LINK_INFO
  205. // and NDIS_WAN_GET_LINK_INFO in ndiswan.h
  206. //
  207. typedef struct _WAN_LINK_INFO {
  208. IN ULONG MaxSendFrameSize;
  209. IN ULONG MaxRecvFrameSize;
  210. ULONG HeaderPadding;
  211. ULONG TailPadding;
  212. IN ULONG SendFramingBits;
  213. IN ULONG RecvFramingBits;
  214. IN ULONG SendCompressionBits;
  215. IN ULONG RecvCompressionBits;
  216. IN ULONG SendACCM;
  217. IN ULONG RecvACCM;
  218. IN ULONG MaxRSendFrameSize;
  219. IN ULONG MaxRRecvFrameSize;
  220. } WAN_LINK_INFO, *PWAN_LINK_INFO;
  221. //
  222. // Structure used to get general information about
  223. // a wan link
  224. //
  225. typedef struct _WAN_INFO {
  226. OUT ULONG MaxFrameSize;
  227. OUT ULONG MaxTransmit;
  228. OUT ULONG FramingBits;
  229. OUT ULONG DesiredACCM;
  230. OUT ULONG MaxReconstructedFrameSize;
  231. OUT ULONG LinkSpeed;
  232. } WAN_INFO, *PWAN_INFO;
  233. //
  234. // Structure used to get general information about
  235. // a wan bundle
  236. //
  237. typedef struct _BUNDLE_INFO {
  238. OUT ULONG SendFramingBits; // Current send framing bits
  239. OUT ULONG SendBundleSpeed; // Current send speed (bps)
  240. OUT ULONG SendMSCompType; // Current send MPPE/MPPC bits
  241. OUT ULONG SendAuthType; // Current send Auth
  242. OUT ULONG RecvFramingBits; // Current recv framing bits
  243. OUT ULONG RecvBundleSpeed; // Current recv speed (bps)
  244. OUT ULONG RecvMSCompType; // Current recv MPPE/MPPC bits
  245. OUT ULONG RecvAuthType; // Current recv Auth
  246. } BUNDLE_INFO, *PBUNDLE_INFO;
  247. //
  248. // Structure used to set Protocol Utilization
  249. //
  250. typedef struct _PROTOCOL_UTILIZATION {
  251. USHORT usProtocolType;
  252. USHORT usUtilization;
  253. } PROTOCOL_UTILIZATION, *PPROTOCOL_UTILIZATION;
  254. //
  255. // Encryption key sizes
  256. //
  257. #ifndef MAX_SESSIONKEY_SIZE
  258. #define MAX_SESSIONKEY_SIZE 8
  259. #endif
  260. #ifndef MAX_USERSESSIONKEY_SIZE
  261. #define MAX_USERSESSIONKEY_SIZE 16
  262. #endif
  263. #ifndef MAX_CHALLENGE_SIZE
  264. #define MAX_CHALLENGE_SIZE 8
  265. #endif
  266. #define MAX_NT_RESPONSE 24
  267. #define MAX_EAPKEY_SIZE 256
  268. //
  269. // Defines for COMPRESS_INFO AuthType field
  270. //
  271. #define AUTH_USE_MSCHAPV1 0x00000001
  272. #define AUTH_USE_MSCHAPV2 0x00000002
  273. #define AUTH_USE_EAP 0x00000003
  274. //
  275. // Defines for COMPRESS_INFO flags
  276. //
  277. #define CCP_PAUSE_DATA 0x00000001 // the bit is set if the bundle
  278. // should pause data transfer
  279. // the bit is cleared if the bundle
  280. // should resume data transfer
  281. #define CCP_IS_SERVER 0x00000002 // this bit is set if the bundle
  282. // is the server
  283. // the bit is cleared if the bundle
  284. // is the client
  285. #define CCP_SET_KEYS 0x00000004 // indicates that the key
  286. // information is valid
  287. #define CCP_SET_COMPTYPE 0x00000008 // indicates that the comptype
  288. // bits are valid
  289. //
  290. // Structure used to get and set compression information
  291. //
  292. typedef struct _COMPRESS_INFO {
  293. UCHAR LMSessionKey[MAX_SESSIONKEY_SIZE];
  294. UCHAR UserSessionKey[MAX_USERSESSIONKEY_SIZE];
  295. UCHAR Challenge[MAX_CHALLENGE_SIZE];
  296. UCHAR NTResponse[MAX_NT_RESPONSE];
  297. ULONG MSCompType;
  298. ULONG AuthType;
  299. UCHAR CompType;
  300. USHORT CompLength;
  301. union {
  302. struct {
  303. UCHAR CompOUI[3];
  304. UCHAR CompSubType;
  305. UCHAR CompValues[32];
  306. } Proprietary;
  307. struct {
  308. UCHAR CompValues[32];
  309. } Public;
  310. };
  311. ULONG Flags;
  312. ULONG EapKeyLength;
  313. UCHAR EapKey[MAX_EAPKEY_SIZE];
  314. } COMPRESS_INFO, *PCOMPRESS_INFO;
  315. //
  316. // Flags to identify protocol events
  317. //
  318. #define PROTOCOL_ADDED 0x00000001
  319. #define PROTOCOL_REMOVED 0x00000002
  320. //
  321. // Structure to get protocol event
  322. //
  323. typedef struct _PROTOCOL_EVENT {
  324. USHORT usProtocolType;
  325. USHORT usReserved;
  326. ULONG ulFlags;
  327. } PROTOCOL_EVENT, *PPROTOCOL_EVENT;
  328. //
  329. // Structure used to get protocol info
  330. //
  331. typedef struct _WAN_PROTOCOL_INFO {
  332. USHORT ProtocolType; // protocol's Ethertype
  333. USHORT PPPId; // protocol's PPP ID
  334. ULONG MTU; // MTU being used
  335. ULONG TunnelMTU; // MTU used for tunnels
  336. ULONG PacketQueueDepth; // max depth of packet queue (in seconds)
  337. } WAN_PROTOCOL_INFO, *PWAN_PROTOCOL_INFO;
  338. //
  339. // Structure used to get and set VJ header compression information
  340. //
  341. typedef struct _VJ_INFO {
  342. USHORT IPCompressionProtocol;
  343. UCHAR MaxSlotID;
  344. UCHAR CompSlotID;
  345. } VJ_INFO, *PVJ_INFO;
  346. //
  347. // Structure used to get and set IPX header compression information
  348. //
  349. typedef struct _CIPX_INFO {
  350. USHORT IPXCompressionProtocol;
  351. } CIPX_INFO, *PCIPX_INFO;
  352. //
  353. // Structure used to get and set encryption information
  354. //
  355. typedef struct __ENCRYPT_INFO {
  356. UCHAR EncryptType;
  357. USHORT EncryptLength;
  358. union {
  359. struct {
  360. UCHAR EncryptOUI[3];
  361. UCHAR EncryptSubtype;
  362. UCHAR EncryptValues[1];
  363. } Proprietary;
  364. struct {
  365. UCHAR EncryptValues[1];
  366. } Public;
  367. };
  368. } ENCRYPT_INFO, *PENCRYPT_INFO;
  369. //
  370. // Structure used in IOCTL_NDISWAN_MAP_CONNECTION_ID
  371. //
  372. typedef struct _NDISWAN_MAP_CONNECTION_ID {
  373. OUT NDIS_HANDLE hLinkHandle;
  374. OUT NDIS_HANDLE hBundleHandle;
  375. IN NDIS_HANDLE hConnectionID;
  376. IN NDIS_HANDLE hLinkContext;
  377. IN NDIS_HANDLE hBundleContext;
  378. IN ULONG ulNameLength;
  379. IN CHAR szName[1];
  380. } NDISWAN_MAP_CONNECTION_ID, *PNDISWAN_MAP_CONNECTION_ID;
  381. //
  382. // Structure used in IOCTL_NDISWAN_GET_BUNDLE_HANDLE
  383. //
  384. typedef struct _NDISWAN_GET_BUNDLE_HANDLE {
  385. OUT NDIS_HANDLE hBundleHandle;
  386. IN NDIS_HANDLE hLinkHandle;
  387. } NDISWAN_GET_BUNDLE_HANDLE, *PNDISWAN_GET_BUNDLE_HANDLE;
  388. //
  389. // Structure used in IOCTL_NDISWAN_SET_FRIENDLY_NAME
  390. //
  391. typedef struct _NDISWAN_SET_FRIENDLY_NAME {
  392. IN NDIS_HANDLE hHandle;
  393. IN USHORT usHandleType;
  394. IN ULONG ulNameLength;
  395. IN CHAR szName[1];
  396. } NDISWAN_SET_FRIENDLY_NAME, *PNDISWAN_SET_FRIENDLY_NAME;
  397. //
  398. // Structure used in IOCTL_NDISWAN_ROUTE
  399. //
  400. typedef struct _NDISWAN_ROUTE {
  401. IN NDIS_HANDLE hBundleHandle;
  402. IN USHORT usProtocolType;
  403. IN USHORT usBindingNameLength;
  404. IN WCHAR BindingName[MAX_NAME_LENGTH];
  405. OUT USHORT usDeviceNameLength;
  406. OUT WCHAR DeviceName[MAX_NAME_LENGTH];
  407. IN ULONG ulBufferLength;
  408. IN UCHAR Buffer[1];
  409. } NDISWAN_ROUTE, *PNDISWAN_ROUTE;
  410. //
  411. // Structure used in IOCTL_NDISWAN_UNROUTE
  412. //
  413. typedef struct _NDISWAN_UNROUTE {
  414. IN NDIS_HANDLE hBundleHandle;
  415. IN USHORT usProtocolType;
  416. } NDISWAN_UNROUTE, *PNDISWAN_UNROUTE;
  417. //
  418. // Structure used in IOCTL_NDISWAN_ADD_LINK_TO_BUNDLE
  419. //
  420. typedef struct _NDISWAN_ADD_LINK_TO_BUNDLE {
  421. IN NDIS_HANDLE hBundleHandle;
  422. IN NDIS_HANDLE hLinkHandle;
  423. } NDISWAN_ADD_LINK_TO_BUNDLE, *PNDISWAN_ADD_LINK_TO_BUNDLE;
  424. //
  425. // Structure used in IOCTL_NDISWAN_ENUM_LINKS_IN_BUNDLE
  426. //
  427. typedef struct _NDISWAN_ENUM_LINKS_IN_BUNDLE {
  428. IN NDIS_HANDLE hBundleHandle;
  429. OUT ULONG ulNumberOfLinks;
  430. OUT NDIS_HANDLE hLinkHandleArray[1];
  431. } NDISWAN_ENUM_LINKS_IN_BUNDLE, *PNDISWAN_ENUM_LINKS_IN_BUNDLE;
  432. //
  433. // Structure used in IOCTL_NDISWAN_SET_PROTOCOL_PRIORITY
  434. //
  435. typedef struct _NDISWAN_SET_PROTOCOL_PRIORITY {
  436. IN NDIS_HANDLE hBundleHandle;
  437. IN USHORT usProtocolType;
  438. IN USHORT usPriority;
  439. } NDISWAN_SET_PROTOCOL_PRIORITY, *PNDISWAN_SET_PROTOCOL_PRIORITY;
  440. //
  441. // Structure used in IOCTL_NDISWAN_SET_BANDWIDTH_ON_DEMAND
  442. //
  443. typedef struct _NDISWAN_SET_BANDWIDTH_ON_DEMAND {
  444. IN NDIS_HANDLE hBundleHandle;
  445. IN USHORT usLowerXmitThreshold;
  446. IN USHORT usUpperXmitThreshold;
  447. IN ULONG ulLowerXmitSamplePeriod;
  448. IN ULONG ulUpperXmitSamplePeriod;
  449. IN USHORT usLowerRecvThreshold;
  450. IN USHORT usUpperRecvThreshold;
  451. IN ULONG ulLowerRecvSamplePeriod;
  452. IN ULONG ulUpperRecvSamplePeriod;
  453. } NDISWAN_SET_BANDWIDTH_ON_DEMAND, *PNDISWAN_SET_BANDWIDTH_ON_DEMAND;
  454. //
  455. // Structure used in IOCTL_NDISWAN_SET_THRESHOLD_EVENT
  456. //
  457. typedef struct _NDISWAN_SET_THRESHOLD_EVENT {
  458. OUT NDIS_HANDLE hBundleContext;
  459. OUT ULONG ulDataType;
  460. OUT ULONG ulThreshold;
  461. } NDISWAN_SET_THRESHOLD_EVENT, *PNDISWAN_SET_THRESHOLD_EVENT;
  462. //
  463. // Structure used in IOCTL_NDISWAN_SEND_PACKET and IOCTL_NDISWAN_RECEIVE_PACKET
  464. //
  465. typedef struct _NDISWAN_IO_PACKET {
  466. IN OUT ULONG PacketNumber;
  467. IN OUT NDIS_HANDLE hHandle;
  468. IN OUT USHORT usHandleType;
  469. IN OUT USHORT usHeaderSize;
  470. IN OUT USHORT usPacketSize;
  471. IN OUT USHORT usPacketFlags;
  472. IN OUT UCHAR PacketData[1];
  473. } NDISWAN_IO_PACKET, *PNDISWAN_IO_PACKET;
  474. //
  475. // Structure used in IOCTL_NDISWAN_GET_STATS
  476. //
  477. typedef struct _NDISWAN_GET_STATS {
  478. IN NDIS_HANDLE hHandle;
  479. IN USHORT usHandleType;
  480. OUT struct _STATS {
  481. OUT WAN_STATS BundleStats;
  482. OUT WAN_STATS LinkStats;
  483. } Stats;
  484. } NDISWAN_GET_STATS, *PNDISWAN_GET_STATS;
  485. //
  486. // Structure used in IOCTL_NDISWAN_GET_BANDWIDTH_UTILIZATION
  487. //
  488. typedef struct _NDISWAN_GET_BANDWIDTH_UTILIZATION {
  489. IN NDIS_HANDLE hBundleHandle;
  490. OUT ULONG ulUpperXmitUtil;
  491. OUT ULONG ulLowerXmitUtil;
  492. OUT ULONG ulUpperRecvUtil;
  493. OUT ULONG ulLowerRecvUtil;
  494. } NDISWAN_GET_BANDWIDTH_UTILIZATION, *PNDISWAN_GET_BANDWIDTH_UTILIZATION;
  495. //
  496. // Structure used in IOCTL_NDISWAN_ENUM_PROTOCOL_UTILIZATION
  497. //
  498. typedef struct _NDISWAN_ENUM_PROTOCOL_UTILIZATION {
  499. IN NDIS_HANDLE hBundleHandle;
  500. OUT PROTOCOL_UTILIZATION ProtocolArray[1];
  501. } NDISWAN_ENUM_PROTOCOL_UTILIZATION, *PNDISWAN_ENUM_PROTOCOL_UTILIZATION;
  502. //
  503. // Structure used in IOCTL_NDISWAN_ENUM_ACTIVE_BUNDLES
  504. //
  505. typedef struct _NDISWAN_ENUM_ACTIVE_BUNDLES {
  506. OUT ULONG ulNumberOfActiveBundles;
  507. } NDISWAN_ENUM_ACTIVE_BUNDLES, *PNDISWAN_ENUM_ACTIVE_BUNDLES;
  508. //
  509. // Structure used in IOCTL_NDISWAN_SET_LINK_INFO
  510. //
  511. typedef struct _NDISWAN_SET_LINK_INFO {
  512. IN NDIS_HANDLE hLinkHandle;
  513. IN WAN_LINK_INFO LinkInfo;
  514. } NDISWAN_SET_LINK_INFO, *PNDISWAN_SET_LINK_INFO;
  515. //
  516. // Structure used in IOCTL_NDISWAN_GET_LINK_INFO
  517. //
  518. typedef struct _NDISWAN_GET_LINK_INFO {
  519. IN NDIS_HANDLE hLinkHandle;
  520. OUT WAN_LINK_INFO LinkInfo;
  521. } NDISWAN_GET_LINK_INFO, *PNDISWAN_GET_LINK_INFO;
  522. //
  523. // Structure used in IOCTL_NDISWAN_GET_WAN_INFO
  524. //
  525. typedef struct _NDISWAN_GET_WAN_INFO {
  526. IN NDIS_HANDLE hLinkHandle;
  527. OUT WAN_INFO WanInfo;
  528. } NDISWAN_GET_WAN_INFO, *PNDISWAN_GET_WAN_INFO;
  529. //
  530. // Structure used in IOCTL_NDISWAN_SET_COMPRESSION_INFO
  531. //
  532. typedef struct _NDISWAN_SET_COMPRESSION_INFO {
  533. IN NDIS_HANDLE hLinkHandle;
  534. IN COMPRESS_INFO SendCapabilities;
  535. IN COMPRESS_INFO RecvCapabilities;
  536. } NDISWAN_SET_COMPRESSION_INFO, *PNDISWAN_SET_COMPRESSION_INFO;
  537. //
  538. // Structure used in IOCTL_NDISWAN_GET_COMPRESSION_INFO
  539. //
  540. typedef struct _NDISWAN_GET_COMPRESSION_INFO {
  541. IN NDIS_HANDLE hLinkHandle;
  542. OUT COMPRESS_INFO SendCapabilities;
  543. OUT COMPRESS_INFO RecvCapabilities;
  544. } NDISWAN_GET_COMPRESSION_INFO, *PNDISWAN_GET_COMPRESSION_INFO;
  545. //
  546. // Structure used in IOCTL_NDISWAN_SET_VJ_INFO
  547. //
  548. typedef struct _NDISWAN_SET_VJ_INFO {
  549. IN NDIS_HANDLE hLinkHandle;
  550. IN VJ_INFO SendCapabilities;
  551. IN VJ_INFO RecvCapabilities;
  552. } NDISWAN_SET_VJ_INFO, *PNDISWAN_SET_VJ_INFO;
  553. //
  554. // Structure used in IOCTL_NDISWAN_GET_VJ_INFO
  555. //
  556. typedef struct _NDISWAN_GET_VJ_INFO {
  557. IN NDIS_HANDLE hLinkHandle;
  558. OUT VJ_INFO SendCapabilities;
  559. OUT VJ_INFO RecvCapabilities;
  560. } NDISWAN_GET_VJ_INFO, *PNDISWAN_GET_VJ_INFO;
  561. //
  562. // Structure used in IOCTL_NDISWAN_SET_BRIDGE_INFO
  563. //
  564. typedef struct _NDISWAN_SET_BRIDGE_INFO {
  565. IN NDIS_HANDLE hLinkHandle;
  566. IN USHORT LanSegmentNumber;
  567. IN UCHAR BridgeNumber;
  568. IN UCHAR BridgingOptions;
  569. IN ULONG BridgingCapabilities;
  570. IN UCHAR BridgingType;
  571. IN UCHAR MacBytes[6];
  572. } NDISWAN_SET_BRIDGE_INFO, *PNDISWAN_SET_BRIDGE_INFO;
  573. //
  574. // Structure used in IOCTL_NDISWAN_GET_BRIDGE_INFO
  575. //
  576. typedef struct _NDISWAN_GET_BRIDGE_INFO {
  577. IN NDIS_HANDLE hLinkHandle;
  578. OUT USHORT LanSegmentNumber;
  579. OUT UCHAR BridgeNumber;
  580. OUT UCHAR BridgingOptions;
  581. OUT ULONG BridgingCapabilities;
  582. OUT UCHAR BridgingType;
  583. OUT UCHAR MacBytes[6];
  584. } NDISWAN_GET_BRIDGE_INFO, *PNDISWAN_GET_BRIDGE_INFO;
  585. //
  586. // Structure used in IOCTL_NDISWAN_SET_CIPX_INFO
  587. //
  588. typedef struct _NDISWAN_SET_CIPX_INFO {
  589. IN NDIS_HANDLE hLinkHandle;
  590. IN CIPX_INFO SendCapabilities;
  591. IN CIPX_INFO RecvCapabilities;
  592. } NDISWAN_SET_CIPX_INFO, *PNDISWAN_SET_CIPX_INFO;
  593. //
  594. // Structure used in IOCTL_NDISWAN_GET_CIPX_INFO
  595. //
  596. typedef struct _NDISWAN_GET_CIPX_INFO {
  597. IN NDIS_HANDLE hLinkHandle;
  598. OUT CIPX_INFO SendCapabilities;
  599. OUT CIPX_INFO RecvCapabilities;
  600. } NDISWAN_GET_CIPX_INFO, *PNDISWAN_GET_CIPX_INFO;
  601. //
  602. // Structure used in IOCTL_NDISWAN_SET_ENCRYPTION_INFO
  603. //
  604. typedef struct _NDISWAN_SET_ENCRYPTION_INFO {
  605. IN NDIS_HANDLE hLinkHandle;
  606. IN ENCRYPT_INFO SendCapabilities;
  607. IN ENCRYPT_INFO RecvCapabilities;
  608. } NDISWAN_SET_ENCRYPTION_INFO, *PNDISWAN_SET_ENCRYPTION_INFO;
  609. //
  610. // Structure used in IOCTL_NDISWAN_GET_ENCRYPTION_INFO
  611. //
  612. typedef struct _NDISWAN_GET_ENCRYPTION_INFO {
  613. IN NDIS_HANDLE hLinkHandle;
  614. IN ENCRYPT_INFO SendCapabilities;
  615. IN ENCRYPT_INFO RecvCapabilities;
  616. } NDISWAN_GET_ENCRYPTION_INFO, *PNDISWAN_GET_ENCRYPTION_INFO;
  617. //
  618. // Structure used in IOCTL_NDISWAN_GET_IDLE_TIME
  619. //
  620. typedef struct _NDISWAN_GET_IDLE_TIME {
  621. IN NDIS_HANDLE hBundleHandle;
  622. IN USHORT usProtocolType;
  623. OUT ULONG ulSeconds;
  624. } NDISWAN_GET_IDLE_TIME, *PNDISWAN_GET_IDLE_TIME;
  625. //
  626. // Structure used in IOCTL_NDISWAN_SET_DEBUG_INFO
  627. //
  628. typedef struct _NDISWAN_SET_DEBUG_INFO {
  629. IN ULONG ulDebugLevel;
  630. IN ULONG ulDebugMask;
  631. }NDISWAN_SET_DEBUG_INFO, *PNDISWAN_SET_DEBUG_INFO;
  632. //
  633. // Structure used in IOCTL_NDISWAN_ENUM_MINIPORTCB, OPENCB
  634. //
  635. typedef struct _NDISWAN_ENUMCB {
  636. OUT ULONG ulNumberOfCBs;
  637. OUT PVOID Address[1];
  638. } NDISWAN_ENUMCB, *PNDISWAN_ENUMCB;
  639. //
  640. // Structure used in IOCTL_NDISWAN_GET_NDISWANCB, MINIPORTCB, OPENCB
  641. //
  642. typedef struct _NDISWAN_DUMPCB {
  643. IN OUT PVOID Address;
  644. OUT UCHAR Buffer[1];
  645. } NDISWAN_DUMPCB, *PNDISWAN_DUMPCB;
  646. //
  647. // Defines for DriverCaps
  648. //
  649. #define NDISWAN_128BIT_ENABLED 0x00000001
  650. //
  651. // Structure used in IOCTL_NDISWAN_GET_DRIVER_INFO
  652. //
  653. typedef struct _NDISWAN_DRIVER_INFO {
  654. OUT ULONG DriverCaps;
  655. OUT ULONG Reserved;
  656. } NDISWAN_DRIVER_INFO, *PNDISWAN_DRIVER_INFO;
  657. //
  658. // Structure used in IOCTL_NDISWAN_GET_PROTOCOL_EVENT
  659. //
  660. typedef struct _NDISWAN_GET_PROTOCOL_EVENT {
  661. OUT ULONG ulNumProtocols;
  662. OUT PROTOCOL_EVENT ProtocolEvent[MAX_PROTOCOLS];
  663. }NDISWAN_GET_PROTOCOL_EVENT, *PNDISWAN_GET_PROTOCOL_EVENT;
  664. //
  665. // Structure used in IOCTL_NDISWAN_GET_PROTOCOL_INFO
  666. //
  667. typedef struct _NDISWAN_GET_PROTOCOL_INFO {
  668. OUT ULONG ulNumProtocols;
  669. OUT WAN_PROTOCOL_INFO ProtocolInfo[MAX_PROTOCOLS];
  670. }NDISWAN_GET_PROTOCOL_INFO, *PNDISWAN_GET_PROTOCOL_INFO;
  671. //
  672. // Structure used in IOCTL_NDISWAN_GET_BUNDLE_INFO
  673. //
  674. typedef struct _NDISWAN_GET_BUNDLE_INFO {
  675. IN NDIS_HANDLE hBundleHandle;
  676. OUT BUNDLE_INFO BundleInfo;
  677. }NDISWAN_GET_BUNDLE_INFO, *PNDISWAN_GET_BUNDLE_INFO;
  678. //
  679. // Structure used in IOCTL_UNNDISWAN_MAP_CONNECTION_ID
  680. //
  681. typedef struct _NDISWAN_UNMAP_CONNECTION_ID {
  682. IN NDIS_HANDLE hLinkHandle;
  683. } NDISWAN_UNMAP_CONNECTION_ID, *PNDISWAN_UNMAP_CONNECTION_ID;
  684. #endif // WAN_PUB