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.

288 lines
6.3 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. transfdrv.h
  5. Abstract:
  6. This file contains defines for the NdisWan driver.
  7. Author:
  8. Tony Bell (TonyBe) January 36, 1998
  9. Environment:
  10. Kernel Mode
  11. Revision History:
  12. TonyBe 01/26/98 Created
  13. --*/
  14. #ifndef _TRANSDRV_
  15. #define _TRANSDRV_
  16. //
  17. // Transform Driver client handlers
  18. //
  19. typedef
  20. NTSTATUS
  21. (*CL_TRANS_REGISTER)(
  22. IN PVOID ClientOpenContext,
  23. IN ULONG CharacteristicsSize,
  24. IN struct _TRANSFORM_CHARACTERISTICS *Characteristics,
  25. IN ULONG TransformCapsSize,
  26. IN struct _TRANSFORM_INFO *TransformCaps
  27. );
  28. typedef
  29. VOID
  30. (*CL_TRANS_TX_COMPLETE)(
  31. IN NTSTATUS Status,
  32. IN PVOID ClientTxContext,
  33. IN PMDL InData,
  34. IN PMDL OutData,
  35. IN ULONG OutDataOffset,
  36. IN ULONG OutDataLength
  37. );
  38. typedef
  39. VOID
  40. (*CL_TRANS_RX_COMPLETE)(
  41. IN NTSTATUS Status,
  42. IN PVOID ClientRxContext,
  43. IN PMDL InData,
  44. IN PMDL OutData,
  45. IN ULONG OutDataOffset,
  46. IN ULONG OutDataLength
  47. );
  48. typedef
  49. NTSTATUS
  50. (*CL_TRANS_SEND_CTRL)(
  51. IN PVOID ClientTxContext,
  52. IN ULONG DataLength,
  53. IN UCHAR Data[1]
  54. );
  55. //
  56. // Transform Driver handlers
  57. //
  58. typedef
  59. NTSTATUS
  60. (*TRANS_ALLOC_CTX)(
  61. IN PVOID ClientTxContext,
  62. OUT PVOID *TransformTxContext,
  63. IN ULONG MaxInputDataSize,
  64. OUT PULONG MaxOutputDataSize,
  65. IN ULONG TransformInfoSize,
  66. IN struct _TRANSFORM_INFO *TransformInfo
  67. );
  68. typedef
  69. NTSTATUS
  70. (*TRANS_ALLOC_CTX)(
  71. IN PVOID ClientRxContext,
  72. OUT PVOID *TransformRxContext,
  73. IN ULONG MaxInputDataSize,
  74. OUT PULONG MaxOutputDataSize,
  75. IN ULONG TransformInfoSize,
  76. IN struct _TRANSFORM_INFO *TransformInfo
  77. );
  78. typedef
  79. VOID
  80. (*TRANS_FREE_CTX)(
  81. IN PVOID TransformContext
  82. );
  83. typedef
  84. VOID
  85. (*TRANS_SET_TXCTX_INFO)(
  86. IN PVOID TransformTxContext,
  87. IN ULONG Cmd,
  88. IN ULONG CmdInfoSize,
  89. IN PUCHAR CmdInfo
  90. );
  91. typedef
  92. VOID
  93. (*TRANS_SET_RXCTX_INFO)(
  94. IN PVOID TransformRxContext,
  95. IN ULONG Cmd,
  96. IN ULONG CmdInfoSize,
  97. IN PUCHAR CmdInfo
  98. );
  99. typedef
  100. NTSTATUS
  101. (*TRANS_TRANSFORM_TX_DATA)(
  102. IN PVOID TransformTxContext,
  103. IN PMDL InData,
  104. IN ULONG InDataOffset,
  105. IN ULONG InDataLength,
  106. IN OUT PMDL OutData,
  107. IN OUT ULONG OutDataOffset,
  108. IN OUT PULONG OutDataLength
  109. );
  110. typedef
  111. NTSTATUS
  112. (*TRANS_TRANSFORM_RX_DATA)(
  113. IN PVOID TransformRxContext,
  114. IN PMDL InData,
  115. IN ULONG InDataOffset,
  116. IN ULONG InDataLength,
  117. IN OUT PMDL OutData,
  118. IN OUT ULONG OutDataOffset,
  119. IN OUT PULONG OutDataLength
  120. );
  121. typedef
  122. NTSTATUS
  123. (*TRANS_RECV_CTRL)(
  124. IN PVOID TransformRxContext,
  125. IN ULONG DataLength,
  126. IN UCHAR Data[1]
  127. );
  128. #define FILE_DEVICE_TRANSFORM_DRIVER 0x066
  129. #define FUNC_TRANSFORM_OPEN 0
  130. #define FUNC_TRANSFORM_CLOSE 1
  131. #define TRANSFORM_CTL_CODE(_Function) \
  132. CTL_CODE(FILE_DEVICE_TRANSFORM_DRIVER, _Function, METHOD_BUFFERED, FILE_ANY_ACCESS)
  133. #define IOCTL_TRANSFORM_OPEN \
  134. TRANSFORM_CTL_CODE(FUNC_TRANSFORM_OPEN)
  135. #define IOCTL_TRANSFORM_CLOSE \
  136. TRANSFORM_CTL_CODE(FUNC_TRANSFORM_CLOSE)
  137. #define HARDWARE_ACCELERATED 0x00000001
  138. #define FRAMING_MODE 0x00000001
  139. #define RAW_MODE 0x00000002
  140. #define DATA_EXPANSION 0x00000004
  141. typedef enum _TRANSFOR_IE_TYPE {
  142. TRANS_PPP_COMPRESSION = 1,
  143. TRANS_PPP_ENCRYPTION,
  144. TRANS_IPSEC_ENCRYPTION,
  145. TRANS_IPSEC_HASHING
  146. } TRANSFORM_IE_TYPE;
  147. typedef struct _TRANSFORM_OPEN {
  148. IN PVOID ClientOpenContext;
  149. OUT PVOID *TransformOpenContext;
  150. IN UCHAR MajorVersion;
  151. IN UCHAR MinorVersion;
  152. IN CL_TRANS_REGISTER TransformRegisterHandler;
  153. IN CL_TRANS_TX_COMPLETE TransformTxCompleteHandler;
  154. IN CL_TRANS_RX_COMPLETE TransformRxCompleteHandler;
  155. IN CL_TRANS_SEND_CTRL SendCtrlPacketHandler;
  156. } TRANSFORM_OPEN, *PTRANSFORM_OPEN;
  157. typedef struct _TRANSFORM_CLOSE {
  158. IN PVOID TransformOpenContext;
  159. } TRANSFORM_CLOSE, *PTRANSFORM_CLOSE;
  160. typedef struct _TRANSFORM_CHARACTERISTICS {
  161. UCHAR MajorVersion;
  162. UCHAR MinorVersion;
  163. USHORT Reserved;
  164. ULONG Flags;
  165. // TRANS_GET_INFO GetInfoHandler;
  166. TRANS_ALLOC_CTX AllocTxCtxHandler;
  167. TRANS_ALLOC_CTX AllocateRxCtxHandle;
  168. TRANS_FREE_CTX FreeCtxHandler;
  169. TRANS_SET_TXCTX_INFO SetTxCtxInfoHandler;
  170. TRANS_SET_RXCTX_INFO SetRxCtxInfoHandler;
  171. TRANS_TRANSFORM_TX_DATA TransformTxDataHandler;
  172. TRANS_TRANSFORM_RX_DATA TransformRxDataHandler;
  173. TRANS_RECV_CTRL RecvCtrlPacketHandler;
  174. } TRANSFORM_CHARACTERISTICS, *PTRANSFORM_CHARACTERISTICS;
  175. typedef struct _TRANSFORM_INFO {
  176. ULONG InfoElementCount;
  177. UCHAR InfoElements[1];
  178. } TRANSFORM_INFO, *PTRANSFORM_INFO;
  179. typedef struct _TRANSFORM_IE {
  180. TRANSFORM_IE_TYPE IEType;
  181. ULONG IESize;
  182. ULONG Flags;
  183. UCHAR IEData[1];
  184. } TRANSFORM_IE, *PTRANSFORM_IE;
  185. //
  186. // Encryption key sizes
  187. //
  188. #ifndef MAX_SESSIONKEY_SIZE
  189. #define MAX_SESSIONKEY_SIZE 8
  190. #endif
  191. #ifndef MAX_USERSESSIONKEY_SIZE
  192. #define MAX_USERSESSIONKEY_SIZE 16
  193. #endif
  194. #ifndef MAX_CHALLENGE_SIZE
  195. #define MAX_CHALLENGE_SIZE 8
  196. #endif
  197. typedef struct _IE_CCP {
  198. //
  199. // MPPC/MPPE specific fields
  200. //
  201. UCHAR LMSessionKey[MAX_SESSIONKEY_SIZE];
  202. UCHAR UserSessionKey[MAX_USERSESSIONKEY_SIZE];
  203. UCHAR Challenge[MAX_CHALLENGE_SIZE];
  204. ULONG MSCompType;
  205. //
  206. // End of MPPC/MPPE specifc fields
  207. //
  208. UCHAR CompType;
  209. USHORT CompLength;
  210. union {
  211. struct {
  212. UCHAR CompOUI[3];
  213. UCHAR CompSubType;
  214. UCHAR CompValues[32];
  215. } Proprietary;
  216. struct {
  217. UCHAR CompValues[32];
  218. } Public;
  219. };
  220. }IE_CCP, *PIE_CCP;
  221. typedef struct IE_ECP{
  222. UCHAR EncryptType;
  223. USHORT EncryptLength;
  224. union {
  225. struct {
  226. UCHAR EncryptOUI[3];
  227. UCHAR EncryptSubtype;
  228. UCHAR EncryptValues[1];
  229. } Proprietary;
  230. struct {
  231. UCHAR EncryptValues[1];
  232. } Public;
  233. };
  234. } IE_ECP, *PIE_ECP;
  235. #endif // _TRANSDRV_