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.

2006 lines
51 KiB

  1. //****************************************************************************
  2. //
  3. // Microsoft NT Remote Access Service
  4. //
  5. // Copyright 1992-93
  6. //
  7. //
  8. // Revision History
  9. //
  10. //
  11. // 5/26/92 Gurdeep Singh Pall Created
  12. //
  13. //
  14. // Description: This file contains all structure and constant definitions for
  15. // RAS Manager Component.
  16. //
  17. //****************************************************************************
  18. #ifndef _RASMAN_
  19. #define _RASMAN_
  20. #define RASMERGE
  21. #include <windows.h>
  22. #include <mprapi.h> // defines for MAX_MEDIA_NAME, MAX_DEVICE_NAME
  23. // MAX_PORT_NAME
  24. #include <ras.h>
  25. #include <rpc.h> // for RPC_BIND_HANDLE
  26. #include <rasapip.h> // for RASEVENT
  27. #define WM_RASAPICOMPLETE 0xCCCC // From the "user" window msg range
  28. #define RASMAN_SERVICE_NAME "RASMAN"
  29. #define MAX_USERKEY_SIZE 132
  30. #define MAX_PARAM_KEY_SIZE 32
  31. #define MAX_XPORT_NAME 128
  32. #define MAX_IDENTIFIER_SIZE 32
  33. #define MAX_STAT_NAME 32
  34. #define MAX_CHALLENGE_SIZE 8
  35. #define MAX_RESPONSE_SIZE 24
  36. #define MAX_USERNAME_SIZE UNLEN
  37. #define MAX_DOMAIN_SIZE DNLEN
  38. #define MAX_PASSWORD_SIZE PWLEN
  39. #define MAX_LAN_NETS 16
  40. #define MAX_PROTOCOLS_PER_PORT 4
  41. #define MAX_DLL_NAME_SIZE 8
  42. #define MAX_ENTRYPOINT_NAME_SIZE 32
  43. #define MAX_ARG_STRING_SIZE 128
  44. #define MAX_ENTRYNAME_SIZE 256
  45. #define MAX_PHONENUMBER_SIZE 128
  46. #define MAX_CALLBACKNUMBER_SIZE MAX_PHONENUMBER_SIZE
  47. #define MAX_PHONEENTRY_SIZE (MAX_PHONENUMBER_SIZE < MAX_ENTRYNAME_SIZE \
  48. ? MAX_ENTRYNAME_SIZE \
  49. : MAX_PHONENUMBER_SIZE)
  50. #define RASMAN_MAX_PROTOCOLS 32 // matches MAX_PROTOCOLS defined in wanpub.h
  51. #define RASMAN_PROTOCOL_ADDED 1
  52. #define RASMAN_PROTOCOL_REMOVED 2
  53. #define INVALID_TAPI_ID 0xffffffff
  54. //
  55. // Defines for Ndiswan DriverCaps
  56. //
  57. #define RAS_NDISWAN_40BIT_ENABLED 0x00000000
  58. #define RAS_NDISWAN_128BIT_ENABLED 0x00000001
  59. typedef HANDLE HPORT ;
  60. typedef HANDLE HBUNDLE ;
  61. typedef HANDLE HCONN;
  62. #define INVALID_HPORT ((HPORT) -1)
  63. enum RASMAN_STATUS {
  64. OPEN = 0,
  65. CLOSED = 1,
  66. UNAVAILABLE = 2,
  67. REMOVED = 3
  68. } ;
  69. typedef enum RASMAN_STATUS RASMAN_STATUS ;
  70. #define CALL_NONE 0x00
  71. #define CALL_IN 0x01
  72. #define CALL_OUT 0x02
  73. #define CALL_ROUTER 0x04
  74. #define CALL_LOGON 0x08
  75. #define CALL_OUT_ONLY 0x10
  76. #define CALL_IN_ONLY 0x20
  77. #define CALL_OUTBOUND_ROUTER 0x40
  78. #define CALL_DEVICE_NOT_FOUND 0x10000000
  79. typedef DWORD RASMAN_USAGE ;
  80. #define RASMAN_ALIGN8(_x) ((_x + 7) & (~7))
  81. #define RASMAN_ALIGN(_x) ((_x + sizeof(ULONG_PTR) - 1) & (~(sizeof(ULONG_PTR) - 1)))
  82. enum RAS_FORMAT {
  83. Number = 0,
  84. String = 1
  85. } ;
  86. typedef enum RAS_FORMAT RAS_FORMAT ;
  87. union RAS_VALUE {
  88. DWORD Number ;
  89. struct
  90. {
  91. DWORD Length ;
  92. DWORD dwAlign;
  93. PCHAR Data ;
  94. } String ;
  95. struct
  96. {
  97. DWORD Length;
  98. DWORD dwAlign1;
  99. DWORD dwOffset;
  100. DWORD dwAlign2;
  101. } String_OffSet;
  102. } ;
  103. typedef union RAS_VALUE RAS_VALUE ;
  104. enum RASMAN_STATE {
  105. CONNECTING = 0,
  106. LISTENING = 1,
  107. CONNECTED = 2,
  108. DISCONNECTING = 3,
  109. DISCONNECTED = 4,
  110. LISTENCOMPLETED = 5,
  111. } ;
  112. typedef enum RASMAN_STATE RASMAN_STATE ;
  113. enum RASMAN_CONNECTION_STATE {
  114. RCS_NOT_CONNECTED = 0,
  115. RCS_CONNECTING,
  116. RCS_CONNECTED
  117. };
  118. typedef enum RASMAN_CONNECTION_STATE RASMAN_CONNECTION_STATE;
  119. enum RASMAN_DISCONNECT_REASON {
  120. USER_REQUESTED = 0,
  121. REMOTE_DISCONNECTION = 1,
  122. HARDWARE_FAILURE = 2,
  123. NOT_DISCONNECTED = 3
  124. } ;
  125. typedef enum RASMAN_DISCONNECT_REASON RASMAN_DISCONNECT_REASON ;
  126. struct RAS_PARAMS {
  127. CHAR P_Key [MAX_PARAM_KEY_SIZE] ;
  128. RAS_FORMAT P_Type ;
  129. BYTE P_Attributes ;
  130. BYTE balign[3];
  131. RAS_VALUE P_Value ;
  132. } ;
  133. typedef struct RAS_PARAMS RAS_PARAMS ;
  134. struct RASMAN_PORT {
  135. HPORT P_Handle ;
  136. CHAR P_PortName [MAX_PORT_NAME] ;
  137. RASMAN_STATUS P_Status ;
  138. RASDEVICETYPE P_rdtDeviceType;
  139. RASMAN_USAGE P_ConfiguredUsage ;
  140. RASMAN_USAGE P_CurrentUsage ;
  141. CHAR P_MediaName [MAX_MEDIA_NAME] ;
  142. CHAR P_DeviceType[MAX_DEVICETYPE_NAME] ;
  143. CHAR P_DeviceName[MAX_DEVICE_NAME+1] ;
  144. DWORD P_LineDeviceId ;
  145. DWORD P_AddressId ;
  146. } ;
  147. typedef struct RASMAN_PORT RASMAN_PORT ;
  148. struct RASMAN_PORT_32 {
  149. DWORD P_Port ;
  150. CHAR P_PortName [MAX_PORT_NAME] ;
  151. RASMAN_STATUS P_Status ;
  152. RASDEVICETYPE P_rdtDeviceType;
  153. RASMAN_USAGE P_ConfiguredUsage ;
  154. RASMAN_USAGE P_CurrentUsage ;
  155. CHAR P_MediaName [MAX_MEDIA_NAME] ;
  156. CHAR P_DeviceType[MAX_DEVICETYPE_NAME] ;
  157. CHAR P_DeviceName[MAX_DEVICE_NAME+1] ;
  158. DWORD P_LineDeviceId ;
  159. DWORD P_AddressId ;
  160. };
  161. typedef struct RASMAN_PORT_32 RASMAN_PORT_32;
  162. struct RASMAN_PORT_400 {
  163. HPORT P_Handle ;
  164. CHAR P_PortName [MAX_PORT_NAME] ;
  165. RASMAN_STATUS P_Status ;
  166. RASMAN_USAGE P_ConfiguredUsage ;
  167. RASMAN_USAGE P_CurrentUsage ;
  168. CHAR P_MediaName [MAX_MEDIA_NAME] ;
  169. CHAR P_DeviceType[MAX_DEVICETYPE_NAME] ;
  170. CHAR P_DeviceName[MAX_DEVICE_NAME+1] ;
  171. DWORD P_LineDeviceId ; // only valid for TAPI devices
  172. DWORD P_AddressId ; // only valid for TAPI devices
  173. } ;
  174. typedef struct RASMAN_PORT_400 RASMAN_PORT_400 ;
  175. struct RASMAN_PORTINFO {
  176. DWORD PI_NumOfParams ;
  177. DWORD dwAlign;
  178. RAS_PARAMS PI_Params[1] ;
  179. } ;
  180. typedef struct RASMAN_PORTINFO RASMAN_PORTINFO ;
  181. struct RASMAN_DEVICE {
  182. CHAR D_Name [MAX_DEVICE_NAME+1] ;
  183. } ;
  184. typedef struct RASMAN_DEVICE RASMAN_DEVICE ;
  185. struct RASMAN_DEVICEINFO {
  186. DWORD DI_NumOfParams ;
  187. DWORD dwAlign;
  188. RAS_PARAMS DI_Params[1] ;
  189. } ;
  190. typedef struct RASMAN_DEVICEINFO RASMAN_DEVICEINFO ;
  191. enum RAS_PROTOCOLTYPE {
  192. ASYBEUI = 0x80D5,
  193. IPX = 0x8137,
  194. IP = 0x0800,
  195. ARP = 0x0806,
  196. APPLETALK = 0x80F3,
  197. XNS = 0x0600,
  198. RASAUTH = 0x8FFF,
  199. INVALID_TYPE= 0x2222
  200. } ;
  201. typedef enum RAS_PROTOCOLTYPE RAS_PROTOCOLTYPE ;
  202. struct RASMAN_PROTOCOLINFO {
  203. CHAR PI_XportName [MAX_XPORT_NAME] ;
  204. RAS_PROTOCOLTYPE PI_Type ;
  205. } ;
  206. typedef struct RASMAN_PROTOCOLINFO RASMAN_PROTOCOLINFO ;
  207. struct RASMAN_ROUTEINFO {
  208. RAS_PROTOCOLTYPE RI_Type ;
  209. BYTE RI_LanaNum ;
  210. WCHAR RI_XportName [MAX_XPORT_NAME] ;
  211. WCHAR RI_AdapterName [MAX_XPORT_NAME] ;
  212. } ;
  213. typedef struct RASMAN_ROUTEINFO RASMAN_ROUTEINFO ;
  214. struct RAS_PROTOCOLS {
  215. RASMAN_ROUTEINFO RP_ProtocolInfo[MAX_PROTOCOLS_PER_PORT] ;
  216. } ;
  217. typedef struct RAS_PROTOCOLS RAS_PROTOCOLS ;
  218. typedef struct _RAS_CALLEDID_INFO
  219. {
  220. DWORD dwSize;
  221. BYTE bCalledId[1];
  222. } RAS_CALLEDID_INFO, *PRAS_CALLEDID_INFO;
  223. typedef struct _RAS_DEVICE_INFO
  224. {
  225. DWORD dwVersion;
  226. BOOL fWrite;
  227. BOOL fRasEnabled;
  228. BOOL fRouterEnabled;
  229. BOOL fRouterOutboundEnabled;
  230. DWORD dwTapiLineId;
  231. DWORD dwError;
  232. DWORD dwNumEndPoints;
  233. DWORD dwMaxOutCalls;
  234. DWORD dwMaxInCalls;
  235. DWORD dwMinWanEndPoints;
  236. DWORD dwMaxWanEndPoints;
  237. RASDEVICETYPE eDeviceType;
  238. GUID guidDevice;
  239. CHAR szPortName[MAX_PORT_NAME + 1];
  240. CHAR szDeviceName[MAX_DEVICE_NAME + 1];
  241. WCHAR wszDeviceName[MAX_DEVICE_NAME + 1];
  242. } RAS_DEVICE_INFO, *PRAS_DEVICE_INFO;
  243. #define RASMAN_DEFAULT_CREDS 0x00000001
  244. #define RASMAN_OPEN_CALLOUT 0x00000002
  245. struct RASMAN_INFO {
  246. RASMAN_STATUS RI_PortStatus ;
  247. RASMAN_STATE RI_ConnState ;
  248. DWORD RI_LinkSpeed ;
  249. DWORD RI_LastError ;
  250. RASMAN_USAGE RI_CurrentUsage ;
  251. CHAR RI_DeviceTypeConnecting [MAX_DEVICETYPE_NAME] ;
  252. CHAR RI_DeviceConnecting [MAX_DEVICE_NAME + 1] ;
  253. CHAR RI_szDeviceType[MAX_DEVICETYPE_NAME];
  254. CHAR RI_szDeviceName[MAX_DEVICE_NAME + 1];
  255. CHAR RI_szPortName[MAX_PORT_NAME + 1];
  256. RASMAN_DISCONNECT_REASON RI_DisconnectReason ;
  257. DWORD RI_OwnershipFlag ;
  258. DWORD RI_ConnectDuration ;
  259. DWORD RI_BytesReceived ;
  260. //
  261. // If this port belongs to a connection, then
  262. // the following fields are filled in.
  263. //
  264. CHAR RI_Phonebook[MAX_PATH+1];
  265. CHAR RI_PhoneEntry[MAX_PHONEENTRY_SIZE+1];
  266. HCONN RI_ConnectionHandle;
  267. DWORD RI_SubEntry;
  268. RASDEVICETYPE RI_rdtDeviceType;
  269. GUID RI_GuidEntry;
  270. DWORD RI_dwSessionId;
  271. DWORD RI_dwFlags;
  272. } ;
  273. typedef struct RASMAN_INFO RASMAN_INFO ;
  274. struct RASMAN_INFO_400 {
  275. RASMAN_STATUS RI_PortStatus ;
  276. RASMAN_STATE RI_ConnState ;
  277. DWORD RI_LinkSpeed ;
  278. DWORD RI_LastError ;
  279. RASMAN_USAGE RI_CurrentUsage ;
  280. CHAR RI_DeviceTypeConnecting [MAX_DEVICETYPE_NAME] ;
  281. CHAR RI_DeviceConnecting [MAX_DEVICE_NAME+1] ;
  282. RASMAN_DISCONNECT_REASON RI_DisconnectReason ;
  283. DWORD RI_OwnershipFlag ;
  284. DWORD RI_ConnectDuration ;
  285. DWORD RI_BytesReceived ;
  286. //
  287. // If this port belongs to a connection, then
  288. // the following fields are filled in.
  289. //
  290. CHAR RI_Phonebook[MAX_PATH+1];
  291. CHAR RI_PhoneEntry[MAX_PHONEENTRY_SIZE+1];
  292. HCONN RI_ConnectionHandle;
  293. DWORD RI_SubEntry;
  294. } ;
  295. typedef struct RASMAN_INFO_400 RASMAN_INFO_400 ;
  296. struct RAS_STATISTICS {
  297. WORD S_NumOfStatistics ;
  298. ULONG S_Statistics[1] ;
  299. } ;
  300. typedef struct RAS_STATISTICS RAS_STATISTICS ;
  301. #define MAX_STATISTICS 14
  302. #define MAX_STATISTICS_EX (MAX_STATISTICS * 2)
  303. #define MAX_STATISTICS_EXT 12
  304. struct RAS_DEVCONFIG
  305. {
  306. DWORD dwOffsetofModemSettings;
  307. DWORD dwSizeofModemSettings;
  308. DWORD dwOffsetofExtendedCaps;
  309. DWORD dwSizeofExtendedCaps;
  310. BYTE abInfo[1];
  311. };
  312. typedef struct RAS_DEVCONFIG RAS_DEVCONFIG;
  313. #ifdef RASMERGE
  314. //
  315. // These structures have been added temporarily
  316. // to rasman.h when the RAS ui was moved over.
  317. // They are necessary to get the UI to compile,
  318. // but are not used internally. These structures
  319. // should be removed when the UI is converted to
  320. // mpradmin APIs. (adiscolo 16-Sep-1996)
  321. //
  322. typedef struct _RAS_PORT_STATISTICS
  323. {
  324. // The connection statistics are followed by port statistics
  325. // A connection is across multiple ports.
  326. DWORD dwBytesXmited;
  327. DWORD dwBytesRcved;
  328. DWORD dwFramesXmited;
  329. DWORD dwFramesRcved;
  330. DWORD dwCrcErr;
  331. DWORD dwTimeoutErr;
  332. DWORD dwAlignmentErr;
  333. DWORD dwHardwareOverrunErr;
  334. DWORD dwFramingErr;
  335. DWORD dwBufferOverrunErr;
  336. DWORD dwBytesXmitedUncompressed;
  337. DWORD dwBytesRcvedUncompressed;
  338. DWORD dwBytesXmitedCompressed;
  339. DWORD dwBytesRcvedCompressed;
  340. // the following are the port statistics
  341. DWORD dwPortBytesXmited;
  342. DWORD dwPortBytesRcved;
  343. DWORD dwPortFramesXmited;
  344. DWORD dwPortFramesRcved;
  345. DWORD dwPortCrcErr;
  346. DWORD dwPortTimeoutErr;
  347. DWORD dwPortAlignmentErr;
  348. DWORD dwPortHardwareOverrunErr;
  349. DWORD dwPortFramingErr;
  350. DWORD dwPortBufferOverrunErr;
  351. DWORD dwPortBytesXmitedUncompressed;
  352. DWORD dwPortBytesRcvedUncompressed;
  353. DWORD dwPortBytesXmitedCompressed;
  354. DWORD dwPortBytesRcvedCompressed;
  355. } RAS_PORT_STATISTICS, *PRAS_PORT_STATISTICS;
  356. #define RASSAPI_MAX_PARAM_KEY_SIZE 32
  357. enum RAS_PARAMS_FORMAT {
  358. ParamNumber = 0,
  359. ParamString = 1
  360. } ;
  361. typedef enum RAS_PARAMS_FORMAT RAS_PARAMS_FORMAT ;
  362. union RAS_PARAMS_VALUE {
  363. DWORD Number ;
  364. struct {
  365. DWORD Length ;
  366. PCHAR Data ;
  367. } String ;
  368. } ;
  369. typedef union RAS_PARAMS_VALUE RAS_PARAMS_VALUE ;
  370. struct RAS_PARAMETERS {
  371. CHAR P_Key [RASSAPI_MAX_PARAM_KEY_SIZE] ;
  372. RAS_PARAMS_FORMAT P_Type ;
  373. BYTE P_Attributes ;
  374. RAS_PARAMS_VALUE P_Value ;
  375. } ;
  376. typedef struct RAS_PARAMETERS RAS_PARAMETERS ;
  377. #endif // RASMERGE
  378. #define BYTES_XMITED 0 // Generic Stats
  379. #define BYTES_RCVED 1
  380. #define FRAMES_XMITED 2
  381. #define FRAMES_RCVED 3
  382. #define CRC_ERR 4 // Hardware Stats
  383. #define TIMEOUT_ERR 5
  384. #define ALIGNMENT_ERR 6
  385. #define HARDWARE_OVERRUN_ERR 7
  386. #define FRAMING_ERR 8
  387. #define BUFFER_OVERRUN_ERR 9
  388. #define BYTES_XMITED_UNCOMPRESSED 10 // Compression Stats
  389. #define BYTES_RCVED_UNCOMPRESSED 11
  390. #define BYTES_XMITED_COMPRESSED 12
  391. #define BYTES_RCVED_COMPRESSED 13
  392. #define COMPRESSION_RATIO_IN 10
  393. #define COMPRESSION_RATIO_OUT 11
  394. #define MSTYPE_COMPRESSION 0x00000001
  395. #define MSTYPE_ENCRYPTION_40 0x00000010
  396. #define MSTYPE_ENCRYPTION_40F 0x00000020
  397. #define MSTYPE_ENCRYPTION_128 0x00000040
  398. #define MSTYPE_ENCRYPTION_56 0x00000080
  399. #define MSTYPE_HISTORYLESS 0x01000000
  400. #define MACTYPE_NT31RAS 254
  401. #define MAX_SESSIONKEY_SIZE 8
  402. #define MAX_USERSESSIONKEY_SIZE 16
  403. #define MAX_NT_RESPONSE_SIZE 24
  404. #define MAX_COMPVALUE_SIZE 32
  405. #define MAX_COMPOUI_SIZE 3
  406. #define MAX_EAPKEY_SIZE 256
  407. #define VERSION_40 4
  408. #define VERSION_50 5
  409. #define VERSION_501 6
  410. //
  411. // Information stored in rasman per-connection.
  412. //
  413. #define CONNECTION_PPPMODE_INDEX 0
  414. #define CONNECTION_PPPRESULT_INDEX 1
  415. #define CONNECTION_AMBRESULT_INDEX 2
  416. #define CONNECTION_SLIPRESULT_INDEX 3
  417. #define CONNECTION_PPPREPLYMESSAGE_INDEX 4
  418. #define CONNECTION_IPSEC_INFO_INDEX 5
  419. #define CONNECTION_CREDENTIALS_INDEX 6
  420. #define CONNECTION_CUSTOMAUTHINTERACTIVEDATA_INDEX 7
  421. #define CONNECTION_TCPWINDOWSIZE_INDEX 8
  422. #define CONNECTION_LUID_INDEX 9
  423. #define CONNECTION_REFINTERFACEGUID_INDEX 10
  424. #define CONNECTION_REFDEVICEGUID_INDEX 11
  425. #define CONNECTION_DEVICEGUID_INDEX 12
  426. //
  427. // Information stored in rasman per-port.
  428. //
  429. #define PORT_PHONENUMBER_INDEX 0
  430. #define PORT_DEVICENAME_INDEX 1
  431. #define PORT_DEVICETYPE_INDEX 2
  432. #define PORT_CONNSTATE_INDEX 3
  433. #define PORT_CONNERROR_INDEX 4
  434. #define PORT_CONNRESPONSE_INDEX 5
  435. #define PORT_CUSTOMAUTHDATA_INDEX 6
  436. #define PORT_CUSTOMAUTHINTERACTIVEDATA_INDEX 7
  437. #define PORT_IPSEC_INFO_INDEX 8
  438. #define PORT_USERSID_INDEX 9
  439. #define PORT_DIALPARAMSUID_INDEX 10
  440. #define PORT_OLDPASSWORD_INDEX 11
  441. #define PORT_CREDENTIALS_INDEX 12
  442. //
  443. // IPSEC DOI ESP algorithms
  444. //
  445. #define RASMAN_IPSEC_ESP_DES 0x00000001
  446. #define RASMAN_IPSEC_ESP_DES_40 0x00000002
  447. #define RASMAN_IPSEC_ESP_3_DES 0x00000004
  448. #define RASMAN_IPSEC_ESP_MAX 0x00000008
  449. //
  450. // Defines for COMPRESS_INFO AuthType field
  451. //
  452. #define AUTH_USE_MSCHAPV1 0x00000001
  453. #define AUTH_USE_MSCHAPV2 0x00000002
  454. #define AUTH_USE_EAP 0x00000003
  455. //
  456. // Defines for COMPRESS_INFO flags
  457. //
  458. #define CCP_PAUSE_DATA 0x00000001 // this bit is set if the bundle
  459. // should pause data transfer.
  460. // the bit is cleared if the bundle
  461. // should resume data transfer
  462. #define CCP_IS_SERVER 0x00000002 // this bit is set if the bundle
  463. // is the server
  464. // the bit is cleared if the bundle
  465. // is the client
  466. #define CCP_SET_KEYS 0x00000004 // indicates that the key
  467. // information is valid
  468. #define CCP_SET_COMPTYPE 0x00000008 // indicates that the comptype
  469. enum RAS_L2TP_ENCRYPTION
  470. {
  471. RAS_L2TP_NO_ENCRYPTION = 0, // Request no encryption
  472. RAS_L2TP_OPTIONAL_ENCRYPTION, // Request encryption but none OK
  473. RAS_L2TP_REQUIRE_ENCRYPTION, // Require encryption of any strength
  474. RAS_L2TP_REQUIRE_MAX_ENCRYPTION // Require maximum strength encryption
  475. };
  476. typedef enum RAS_L2TP_ENCRYPTION RAS_L2TP_ENCRYPTION;
  477. struct RAS_COMPRESSION_INFO {
  478. //
  479. // May be used for encryption, non-zero if supported.
  480. //
  481. UCHAR RCI_LMSessionKey[MAX_SESSIONKEY_SIZE];
  482. //
  483. // Used for 128Bit encryption, non-zero if supported.
  484. //
  485. UCHAR RCI_UserSessionKey[MAX_USERSESSIONKEY_SIZE];
  486. //
  487. // Used for 128Bit encryption, only valid if RCI_UserSessionKey is valid.
  488. //
  489. UCHAR RCI_Challenge[MAX_CHALLENGE_SIZE];
  490. UCHAR RCI_NTResponse[MAX_NT_RESPONSE_SIZE];
  491. //
  492. // bit 0 = MPPPC, bit 5 = encryption
  493. //
  494. ULONG RCI_MSCompressionType;
  495. ULONG RCI_AuthType;
  496. //
  497. // 0=OUI, 1-253 = Public, 254 = NT31 RAS, 255=Not supported
  498. //
  499. UCHAR RCI_MacCompressionType;
  500. WORD RCI_MacCompressionValueLength ;
  501. union {
  502. struct { // Proprietary: used for comp type 0
  503. UCHAR RCI_CompOUI[MAX_COMPOUI_SIZE];
  504. UCHAR RCI_CompSubType;
  505. UCHAR RCI_CompValues[MAX_COMPVALUE_SIZE];
  506. } RCI_Proprietary;
  507. struct { // Public: used for comp type 1-254
  508. UCHAR RCI_CompValues[MAX_COMPVALUE_SIZE];
  509. } RCI_Public;
  510. } RCI_Info ;
  511. ULONG RCI_Flags;
  512. ULONG RCI_EapKeyLength;
  513. UCHAR RCI_EapKey[MAX_EAPKEY_SIZE];
  514. };
  515. typedef struct RAS_COMPRESSION_INFO RAS_COMPRESSION_INFO;
  516. struct PROTOCOL_CONFIG_INFO {
  517. DWORD P_Length ;
  518. BYTE P_Info[1] ;
  519. } ;
  520. typedef struct PROTOCOL_CONFIG_INFO PROTOCOL_CONFIG_INFO ;
  521. struct RASMAN_PPPFEATURES {
  522. DWORD MRU;
  523. DWORD ACCM;
  524. DWORD AuthProtocol;
  525. DWORD MagicNumber;
  526. BOOL PFC;
  527. BOOL ACFC;
  528. } ;
  529. typedef struct RASMAN_PPPFEATURES RASMAN_PPPFEATURES ;
  530. enum RAS_FRAMING {PPP, RAS, AUTODETECT, SLIP, SLIPCOMP, SLIPCOMPAUTO} ;
  531. typedef enum RAS_FRAMING RAS_FRAMING ;
  532. struct RAS_FRAMING_CAPABILITIES {
  533. DWORD RFC_MaxFrameSize;
  534. DWORD RFC_MaxReconstructedFrameSize;
  535. DWORD RFC_FramingBits;
  536. DWORD RFC_DesiredACCM;
  537. } ;
  538. typedef struct RAS_FRAMING_CAPABILITIES RAS_FRAMING_CAPABILITIES ;
  539. struct RAS_FRAMING_INFO {
  540. DWORD RFI_MaxSendFrameSize;
  541. DWORD RFI_MaxRecvFrameSize;
  542. DWORD RFI_MaxRSendFrameSize;
  543. DWORD RFI_MaxRRecvFrameSize;
  544. DWORD RFI_HeaderPadding;
  545. DWORD RFI_TailPadding;
  546. DWORD RFI_SendFramingBits;
  547. DWORD RFI_RecvFramingBits;
  548. DWORD RFI_SendCompressionBits;
  549. DWORD RFI_RecvCompressionBits;
  550. DWORD RFI_SendACCM;
  551. DWORD RFI_RecvACCM;
  552. } ;
  553. typedef struct RAS_FRAMING_INFO RAS_FRAMING_INFO ;
  554. // NDIS WAN Framing bits: used with RasPortGetFramingEx and RasPortSetFramingEx
  555. // APIs.
  556. //
  557. #define OLD_RAS_FRAMING 0x00000001
  558. #define RAS_COMPRESSION 0x00000002
  559. #define PPP_MULTILINK_FRAMING 0x00000010
  560. #define PPP_SHORT_SEQUENCE_HDR_FORMAT 0x00000020
  561. #define PPP_FRAMING 0x00000100
  562. #define PPP_COMPRESS_ADDRESS_CONTROL 0x00000200
  563. #define PPP_COMPRESS_PROTOCOL_FIELD 0x00000400
  564. #define PPP_ACCM_SUPPORTED 0x00000800
  565. #define SLIP_FRAMING 0x00001000
  566. #define SLIP_VJ_COMPRESSION 0x00002000
  567. #define SLIP_VJ_AUTODETECT 0x00004000
  568. #define MEDIA_NRZ_ENCODING 0x00010000
  569. #define MEDIA_NRZI_ENCODING 0x00020000
  570. #define MEDIA_NLPID 0x00040000
  571. #define RFC_1356_FRAMING 0x00100000
  572. #define RFC_1483_FRAMING 0x00200000
  573. #define RFC_1490_FRAMING 0x00400000
  574. #define SHIVA_FRAMING 0x01000000
  575. // Defines for RAS_PROTOCOLCOMPRESSION
  576. //
  577. #define VJ_IP_COMPRESSION 0x002d
  578. #define NO_PROTOCOL_COMPRESSION 0x0000
  579. struct RAS_PROTOCOLCOMPRESSION {
  580. union {
  581. struct {
  582. WORD RP_IPCompressionProtocol;
  583. BYTE RP_MaxSlotID; // How many slots to allocate
  584. BYTE RP_CompSlotID; // 1 = Slot ID was negotiated
  585. } RP_IP ;
  586. struct {
  587. WORD RP_IPXCompressionProtocol;
  588. } RP_IPX ;
  589. } RP_ProtocolType ;
  590. } ;
  591. typedef struct RAS_PROTOCOLCOMPRESSION RAS_PROTOCOLCOMPRESSION ;
  592. #define RAS_VERSION 5
  593. #define PT_WORKSTATION 1
  594. #define PT_SERVER 2
  595. #define PS_PERSONAL 1
  596. #define PS_PROFESSIONAL 2
  597. #define GUIDSTRLEN 39
  598. typedef DWORD PRODUCT_TYPE;
  599. typedef DWORD PRODUCT_SKU;
  600. enum _DEVICE_STATUS
  601. {
  602. DS_Enabled = 0,
  603. DS_Disabled,
  604. DS_Unavailable,
  605. DS_Removed
  606. };
  607. typedef enum _DEVICE_STATUS DEVICE_STATUS;
  608. typedef struct DeviceInfo
  609. {
  610. //
  611. // Private fields which are used
  612. // internally in rastapi/rasman
  613. //
  614. struct DeviceInfo *Next;
  615. BOOL fValid; // Is this information valid
  616. DWORD dwCurrentEndPoints; // Current number of ports on this adapter
  617. DWORD dwCurrentDialedInClients; // Number of clients dialed in currently
  618. DWORD dwInstanceNumber; // Instance Number
  619. DWORD dwNextPortNumber; // The number assigned next to distinguish rasman
  620. DEVICE_STATUS eDeviceStatus; // Status of the device
  621. DWORD dwUsage;
  622. RAS_CALLEDID_INFO *pCalledID; // Called id information read from registry
  623. RAS_DEVICE_INFO rdiDeviceInfo; // Device info structure
  624. } DeviceInfo, *pDeviceInfo;
  625. //
  626. // Definitions for Ras{Get,Set}DialParams
  627. //
  628. // The dwMask values control/specify which fields
  629. // of the RAS_DIALPARAMS are stored/retrieved.
  630. //
  631. // NOTE: these values have to match the RASCF_*
  632. // values in ras.h.
  633. //
  634. #define DLPARAMS_MASK_USERNAME 0x00000001
  635. #define DLPARAMS_MASK_PASSWORD 0x00000002
  636. #define DLPARAMS_MASK_DOMAIN 0x00000004
  637. #define DLPARAMS_MASK_PHONENUMBER 0x00000008
  638. #define DLPARAMS_MASK_CALLBACKNUMBER 0x00000010
  639. #define DLPARAMS_MASK_SUBENTRY 0x00000020
  640. #define DLPARAMS_MASK_DEFAULT_CREDS 0x00000040
  641. #define DLPARAMS_MASK_PRESHAREDKEY 0x00000080
  642. #define DLPARAMS_MASK_SERVER_PRESHAREDKEY 0x00000100
  643. #define DLPARAMS_MASK_DDM_PRESHAREDKEY 0x00000200
  644. //
  645. // The following are flags used internall and
  646. // don't really map to external apis. So we are
  647. // defining the bits from MSB.
  648. //
  649. #define DLPARAMS_MASK_OLDSTYLE 0x80000000
  650. #define DLPARAMS_MASK_DELETE 0x40000000
  651. #define DLPARAMS_MASK_DELETEALL 0x20000000
  652. typedef struct _RAS_DIALPARAMS {
  653. DWORD DP_Uid;
  654. WCHAR DP_PhoneNumber[MAX_PHONENUMBER_SIZE + 1];
  655. WCHAR DP_CallbackNumber[MAX_CALLBACKNUMBER_SIZE + 1];
  656. WCHAR DP_UserName[MAX_USERNAME_SIZE + 1];
  657. WCHAR DP_Password[MAX_PASSWORD_SIZE + 1];
  658. WCHAR DP_Domain[MAX_DOMAIN_SIZE + 1];
  659. DWORD DP_SubEntry;
  660. } RAS_DIALPARAMS, *PRAS_DIALPARAMS;
  661. //
  662. // Connection Flags
  663. //
  664. #define CONNECTION_REDIALONLINKFAILURE 0x00000001
  665. #define CONNECTION_SHAREFILEANDPRINT 0x00000002
  666. #define CONNECTION_BINDMSNETCLIENT 0x00000004
  667. #define CONNECTION_USERASCREDENTIALS 0x00000008
  668. #define CONNECTION_USEPRESHAREDKEY 0x00000010
  669. //
  670. // Definitions for Ras{Get,Set}ConnectionParams
  671. //
  672. typedef struct _RAS_CONNECTIONPARAMS {
  673. //
  674. // Phonebook and entry name.
  675. //
  676. CHAR CP_Phonebook[MAX_PATH + 1];
  677. CHAR CP_PhoneEntry[MAX_PHONEENTRY_SIZE + 1];
  678. //
  679. // Idle disconnect parameters
  680. //
  681. DWORD CP_IdleDisconnectSeconds;
  682. //
  683. // Connection Flags
  684. //
  685. DWORD CP_ConnectionFlags;
  686. } RAS_CONNECTIONPARAMS, *PRAS_CONNECTIONPARAMS;
  687. //
  688. // Flags for RasAddNotification.
  689. //
  690. // Note: the NOTIF_* values must match the
  691. // RASCN_* values in ras.h
  692. //
  693. #define NOTIF_CONNECT 0x00000001
  694. #define NOTIF_DISCONNECT 0x00000002
  695. #define NOTIF_BANDWIDTHADDED 0x00000004
  696. #define NOTIF_BANDWIDTHREMOVED 0x00000008
  697. //
  698. // Overlapped I/O structure
  699. // used by the device and media DLLs.
  700. //
  701. // This structure is used with the I/O
  702. // completion port associated with each
  703. // of the port handles.
  704. //
  705. // This structure is also used by the
  706. // rasapi32 dialing machine and PPP event
  707. // mechanism.
  708. //
  709. typedef struct _RAS_OVERLAPPED {
  710. OVERLAPPED RO_Overlapped; // the I/O overlapped structure
  711. DWORD RO_EventType; // OVEVT_* flags below
  712. PVOID RO_Info; // optional
  713. HANDLE RO_hInfo; // optional
  714. } RAS_OVERLAPPED, *PRAS_OVERLAPPED;
  715. typedef struct _NEW_PORT_NOTIF {
  716. PVOID *NPN_pmiNewPort;
  717. CHAR NPN_MediaName[MAX_MEDIA_NAME];
  718. } NEW_PORT_NOTIF, *PNEW_PORT_NOTIF;
  719. typedef struct _REMOVE_LINE_NOTIF {
  720. DWORD dwLineId;
  721. } REMOVE_LINE_NOTIF, *PREMOVE_LINE_NOTIF;
  722. typedef struct _PORT_USAGE_NOTIF {
  723. PVOID *PUN_pmiPort;
  724. CHAR PUN_MediaName[MAX_MEDIA_NAME];
  725. } PORT_USAGE_NOTIF, *PPORT_USAGE_NOTIF;
  726. typedef struct _PNP_EVENT_NOTIF {
  727. DWORD dwEvent;
  728. RASMAN_PORT RasPort;
  729. } PNP_EVENT_NOTIF, *PPNP_EVENT_NOTIF;
  730. #define PNP_NOTIFCALLBACK 0x00000001
  731. #define PNP_NOTIFEVENT 0x00000002
  732. #define PNPNOTIFEVENT_CREATE 0x00000001
  733. #define PNPNOTIFEVENT_REMOVE 0x00000002
  734. #define PNPNOTIFEVENT_USAGE 0x00000004
  735. #define LEGACY_PPTP 0
  736. #define LEGACY_L2TP 1
  737. #define LEGACY_MAX 2
  738. //
  739. // RAS_OVERLAPPED.RO_EventTypes for device
  740. // and medial DLLs.
  741. //
  742. #define OVEVT_DEV_IGNORED 0 // ignored
  743. #define OVEVT_DEV_STATECHANGE 1 // disconnect event
  744. #define OVEVT_DEV_ASYNCOP 2 // async operation event
  745. #define OVEVT_DEV_SHUTDOWN 4 // shutdown event
  746. #define OVEVT_RASMAN_TIMER 6 // timer
  747. #define OVEVT_RASMAN_CLOSE 7 // close event posted by a client to rasman
  748. #define OVEVT_RASMAN_FINAL_CLOSE 8 // event posted by ppp engine when it has shut down
  749. #define OVEVT_RASMAN_RECV_PACKET 9 // event posted by tapi/...
  750. #define OVEVT_RASMAN_THRESHOLD 10 // event notifying setting of a threshold event
  751. #define OVEVT_DEV_CREATE 11 // new port event (PnP)
  752. #define OVEVT_DEV_REMOVE 12 // device remove event (PnP)
  753. #define OVEVT_DEV_CONFIGCHANGE 13 // pptp config changed (PnP)
  754. #define OVEVT_DEV_RASCONFIGCHANGE 14 // Configuration of some device changed (PnP)
  755. #define OVEVT_RASMAN_ADJUST_TIMER 15 // someone added a timer element..
  756. #define OVEVT_RASMAN_HIBERNATE 16 // ndiswan is asking rasman to hibernate
  757. #define OVEVT_RASMAN_PROTOCOL_EVENT 17 // ndiswan indicates a protocol event
  758. #define OVEVT_RASMAN_POST_RECV_PKT 18 // post receive packet in rasmans thread
  759. #define OVEVT_RASMAN_DEREFERENCE_CONNECTION 19 // post event to disconnect
  760. #define OVEVT_RASMAN_POST_STARTRASAUTO 20 // start rasauto service
  761. #define OVEVT_RASMAN_DEFERRED_CLOSE_CONNECTION 21 // Close deferred connections
  762. //
  763. // RAS_OVERLAPPED.RO_EventTypes for rasapi32
  764. // dialing machine and PPP.
  765. //
  766. #define OVEVT_DIAL_IGNORED 0 // ignored
  767. #define OVEVT_DIAL_DROP 1 // port disconnected
  768. #define OVEVT_DIAL_STATECHANGE 2 // rasdial state change
  769. #define OVEVT_DIAL_PPP 3 // PPP event received
  770. #define OVEVT_DIAL_LAST 4 // no more events on this port
  771. #define OVEVT_DIAL_SHUTDOWN 5 // shutdown event
  772. #define REQUEST_BUFFER_SIZE 2500
  773. #define RECEIVE_OUTOF_PROCESS 0x00000001
  774. #define RECEIVE_WAITING 0x00000002
  775. #define RECEIVE_PPPSTARTED 0x00000004
  776. #define RECEIVE_PPPLISTEN 0x00000008
  777. #define RECEIVE_PPPSTOPPED 0x00000010
  778. #define RECEIVE_PPPSTART 0x00000020
  779. #define RASMANFLAG_PPPSTOPPENDING 0x00000001
  780. typedef struct _RAS_RPC
  781. {
  782. RPC_BINDING_HANDLE hRpcBinding;
  783. BOOL fLocal;
  784. DWORD dwVersion;
  785. TCHAR szServer[MAX_COMPUTERNAME_LENGTH + 1];
  786. } RAS_RPC, *PRAS_RPC;
  787. typedef struct _RAS_CUSTOM_AUTH_DATA
  788. {
  789. DWORD cbCustomAuthData;
  790. BYTE abCustomAuthData[1];
  791. } RAS_CUSTOM_AUTH_DATA, *PRAS_CUSTOM_AUTH_DATA;
  792. typedef struct _RAS_CONNECT_INFO
  793. {
  794. DWORD dwCallerIdSize;
  795. CHAR *pszCallerId;
  796. DWORD dwCalledIdSize;
  797. CHAR *pszCalledId;
  798. DWORD dwConnectResponseSize;
  799. CHAR *pszConnectResponse;
  800. DWORD dwAltCalledIdSize;
  801. CHAR *pszAltCalledId;
  802. BYTE abdata[1];
  803. } RAS_CONNECT_INFO, *PRAS_CONNECT_INFO;
  804. typedef struct _RASTAPI_CONNECT_INFO
  805. {
  806. DWORD dwCallerIdSize;
  807. DWORD dwCallerIdOffset;
  808. DWORD dwCalledIdSize;
  809. DWORD dwCalledIdOffset;
  810. DWORD dwConnectResponseSize;
  811. DWORD dwConnectResponseOffset;
  812. DWORD dwAltCalledIdSize;
  813. DWORD dwAltCalledIdOffset;
  814. BYTE abdata[1];
  815. } RASTAPI_CONNECT_INFO, *PRASTAPI_CONNECT_INFO;
  816. typedef struct _EAPLOGONINFO
  817. {
  818. DWORD dwSize;
  819. DWORD dwLogonInfoSize;
  820. DWORD dwOffsetLogonInfo;
  821. DWORD dwPINInfoSize;
  822. DWORD dwOffsetPINInfo;
  823. BYTE abdata[1];
  824. } EAPLOGONINFO, *PEAPLOGONINFO;
  825. //
  826. // Structure used in IOCTL_NDISWAN_GET_DRIVER_INFO
  827. //
  828. typedef struct _RAS_NDISWAN_DRIVER_INFO
  829. {
  830. OUT ULONG DriverCaps;
  831. OUT ULONG Reserved;
  832. } RAS_NDISWAN_DRIVER_INFO, *P_NDISWAN_DRIVER_INFO;
  833. //
  834. // Structure used in IOCTL_NDISWAN_GET_BANDWIDTH_UTILIZATION
  835. //
  836. typedef struct _RAS_GET_BANDWIDTH_UTILIZATION
  837. {
  838. OUT ULONG ulUpperXmitUtil;
  839. OUT ULONG ulLowerXmitUtil;
  840. OUT ULONG ulUpperRecvUtil;
  841. OUT ULONG ulLowerRecvUtil;
  842. } RAS_GET_BANDWIDTH_UTILIZATION, *PRAS_GET_BANDWIDTH_UTILIZATION;
  843. //
  844. // This structure should match the WAN_PROTOCOL_INFO in wanpub.h
  845. //
  846. typedef struct _RASMAN_PROTOCOL_INFO
  847. {
  848. USHORT ProtocolType; // protocol's Ethertype
  849. USHORT PPPId; // protocol's PPP ID
  850. ULONG MTU; // MTU being used
  851. ULONG TunnelMTU; // MTU used for tunnels
  852. ULONG PacketQueueDepth; // max depth of packet queue (in seconds)
  853. } RASMAN_PROTOCOL_INFO, *PRASMAN_PROTOCOL_INFO;
  854. //
  855. // Structure used in IOCTL_NDISWAN_GET_PROTOCOL_INFO
  856. //
  857. typedef struct _RASMAN_GET_PROTOCOL_INFO
  858. {
  859. OUT ULONG ulNumProtocols;
  860. OUT RASMAN_PROTOCOL_INFO ProtocolInfo[RASMAN_MAX_PROTOCOLS];
  861. } RASMAN_GET_PROTOCOL_INFO, *PRASMAN_GET_PROTOCOL_INFO;
  862. typedef struct _RASMANCOMMSETTINGS
  863. {
  864. DWORD dwSize;
  865. BYTE bParity;
  866. BYTE bStop;
  867. BYTE bByteSize;
  868. BYTE bAlign;
  869. } RASMANCOMMSETTINGS, *PRASMANCOMMSETTINGS;
  870. #define RASCRED_LOGON 0x00000001
  871. #define RASCRED_EAP 0x00000002
  872. typedef struct _RASMAN_CREDENTIALS
  873. {
  874. DWORD dwFlags;
  875. USHORT usLength;
  876. USHORT usMaximumLength;
  877. CHAR szUserName[UNLEN + 8];
  878. CHAR szDomain[DNLEN + 1];
  879. WCHAR wszPassword[PWLEN];
  880. UCHAR ucSeed;
  881. } RASMAN_CREDENTIALS, *PRASMAN_CREDENTIALS;
  882. //
  883. // RAS Manager entrypoint Prototypes
  884. //
  885. DWORD RasStartRasAutoIfRequired(void);
  886. DWORD APIENTRY RasPortOpen(PCHAR,
  887. HPORT*,
  888. HANDLE);
  889. DWORD APIENTRY RasPortClose(HPORT);
  890. DWORD APIENTRY RasPortEnum(HANDLE,
  891. PBYTE,
  892. PDWORD,
  893. PDWORD);
  894. DWORD APIENTRY RasPortGetInfo(HANDLE,
  895. HPORT,
  896. PBYTE,
  897. PDWORD);
  898. DWORD APIENTRY RasPortSetInfo(HPORT,
  899. RASMAN_PORTINFO*);
  900. DWORD APIENTRY RasPortDisconnect(HPORT,
  901. HANDLE);
  902. DWORD APIENTRY RasPortSend(HPORT,
  903. PBYTE,
  904. DWORD);
  905. DWORD APIENTRY RasPortReceive(HPORT,
  906. PBYTE,
  907. PDWORD,
  908. DWORD,
  909. HANDLE);
  910. DWORD APIENTRY RasPortListen(HPORT,
  911. DWORD,
  912. HANDLE);
  913. DWORD APIENTRY RasPortConnectComplete(HPORT);
  914. DWORD APIENTRY RasPortGetStatistics(HANDLE,
  915. HPORT,
  916. PBYTE,
  917. PDWORD);
  918. DWORD APIENTRY RasPortClearStatistics(HANDLE,
  919. HPORT);
  920. DWORD APIENTRY RasPortGetStatisticsEx(HANDLE,
  921. HPORT,
  922. PBYTE,
  923. PDWORD);
  924. DWORD APIENTRY RasDeviceEnum(HANDLE,
  925. PCHAR,
  926. PBYTE,
  927. PDWORD,
  928. PDWORD);
  929. DWORD APIENTRY RasDeviceGetInfo(HANDLE,
  930. HPORT,
  931. PCHAR,
  932. PCHAR,
  933. PBYTE,
  934. PDWORD);
  935. DWORD APIENTRY RasDeviceSetInfo(HPORT,
  936. PCHAR,
  937. PCHAR,
  938. RASMAN_DEVICEINFO*);
  939. DWORD APIENTRY RasDeviceConnect(HPORT,
  940. PCHAR,
  941. PCHAR,
  942. DWORD,
  943. HANDLE);
  944. DWORD APIENTRY RasGetInfo( HANDLE,
  945. HPORT,
  946. RASMAN_INFO*);
  947. DWORD APIENTRY RasGetInfoEx( HANDLE,
  948. RASMAN_INFO*,
  949. PWORD);
  950. DWORD APIENTRY RasGetBuffer( PBYTE*,
  951. PDWORD);
  952. DWORD APIENTRY RasFreeBuffer(PBYTE);
  953. DWORD APIENTRY RasProtocolEnum( PBYTE,
  954. PDWORD,
  955. PDWORD);
  956. DWORD APIENTRY RasAllocateRoute( HPORT,
  957. RAS_PROTOCOLTYPE,
  958. BOOL,
  959. RASMAN_ROUTEINFO*);
  960. DWORD APIENTRY RasActivateRoute( HPORT,
  961. RAS_PROTOCOLTYPE,
  962. RASMAN_ROUTEINFO*,
  963. PROTOCOL_CONFIG_INFO*);
  964. DWORD APIENTRY RasActivateRouteEx( HPORT,
  965. RAS_PROTOCOLTYPE,
  966. DWORD,
  967. RASMAN_ROUTEINFO*,
  968. PROTOCOL_CONFIG_INFO*);
  969. DWORD APIENTRY RasDeAllocateRoute( HBUNDLE,
  970. RAS_PROTOCOLTYPE);
  971. DWORD APIENTRY RasCompressionGetInfo( HPORT,
  972. RAS_COMPRESSION_INFO* Send,
  973. RAS_COMPRESSION_INFO* Recv);
  974. DWORD APIENTRY RasCompressionSetInfo( HPORT,
  975. RAS_COMPRESSION_INFO* Send,
  976. RAS_COMPRESSION_INFO* Recv);
  977. DWORD APIENTRY RasGetUserCredentials( PBYTE,
  978. PLUID,
  979. PWCHAR,
  980. PBYTE,
  981. PBYTE,
  982. PBYTE,
  983. PBYTE) ;
  984. DWORD APIENTRY RasSetCachedCredentials( PCHAR,
  985. PCHAR,
  986. PCHAR ) ;
  987. DWORD APIENTRY RasRequestNotification ( HPORT,
  988. HANDLE) ;
  989. DWORD APIENTRY RasPortCancelReceive (HPORT) ;
  990. DWORD APIENTRY RasPortEnumProtocols ( HANDLE,
  991. HPORT,
  992. RAS_PROTOCOLS*,
  993. PDWORD) ;
  994. DWORD APIENTRY RasEnumLanNets ( DWORD *,
  995. UCHAR *) ;
  996. DWORD APIENTRY RasPortSetFraming ( HPORT,
  997. RAS_FRAMING,
  998. RASMAN_PPPFEATURES*,
  999. RASMAN_PPPFEATURES*) ;
  1000. DWORD APIENTRY RasPortRegisterSlip ( HPORT,
  1001. DWORD,
  1002. DWORD,
  1003. BOOL,
  1004. WCHAR*,
  1005. WCHAR*,
  1006. WCHAR*,
  1007. WCHAR*) ;
  1008. DWORD APIENTRY RasPortStoreUserData ( HPORT,
  1009. PBYTE,
  1010. DWORD) ;
  1011. DWORD APIENTRY RasPortRetrieveUserData ( HPORT,
  1012. PBYTE,
  1013. DWORD *) ;
  1014. DWORD APIENTRY RasPortGetFramingEx ( HANDLE,
  1015. HPORT,
  1016. RAS_FRAMING_INFO *) ;
  1017. DWORD APIENTRY RasPortSetFramingEx ( HPORT,
  1018. RAS_FRAMING_INFO *) ;
  1019. DWORD APIENTRY RasPortGetProtocolCompression ( HPORT,
  1020. RAS_PROTOCOLTYPE,
  1021. RAS_PROTOCOLCOMPRESSION *,
  1022. RAS_PROTOCOLCOMPRESSION *) ;
  1023. DWORD APIENTRY RasPortSetProtocolCompression ( HPORT,
  1024. RAS_PROTOCOLTYPE,
  1025. RAS_PROTOCOLCOMPRESSION *,
  1026. RAS_PROTOCOLCOMPRESSION *) ;
  1027. DWORD APIENTRY RasGetFramingCapabilities ( HPORT,
  1028. RAS_FRAMING_CAPABILITIES*) ;
  1029. //DWORD APIENTRY RasInitialize () ;
  1030. DWORD APIENTRY RasPortReserve ( PCHAR,
  1031. HPORT*) ;
  1032. DWORD APIENTRY RasPortFree (HPORT) ;
  1033. DWORD APIENTRY RasPortBundle( HPORT,
  1034. HPORT );
  1035. DWORD APIENTRY RasPortGetBundledPort ( HPORT oldport,
  1036. HPORT *pnewport) ;
  1037. DWORD APIENTRY RasBundleGetPort ( HANDLE hConnection,
  1038. HBUNDLE hbundle,
  1039. HPORT *phport) ;
  1040. DWORD APIENTRY RasPortGetBundle ( HANDLE hConnection,
  1041. HPORT hport,
  1042. HBUNDLE *phbundle) ;
  1043. DWORD APIENTRY RasReferenceRasman (BOOL fAttach);
  1044. DWORD APIENTRY RasGetAttachedCount ( DWORD *pdwAttachedCount );
  1045. DWORD APIENTRY RasGetDialParams ( DWORD dwUID,
  1046. LPDWORD lpdwMask,
  1047. PRAS_DIALPARAMS pDialParams);
  1048. DWORD APIENTRY RasSetDialParams ( DWORD dwOldUID,
  1049. DWORD dwMask,
  1050. PRAS_DIALPARAMS pDialParams,
  1051. BOOL fDelete);
  1052. DWORD APIENTRY RasCreateConnection( HCONN *lphconn,
  1053. DWORD dwSubEntries,
  1054. DWORD *lpdwEntryAlreadyConnected,
  1055. DWORD *lpdwSubEntryInfo,
  1056. DWORD dwDialMode,
  1057. GUID *pGuidEntry,
  1058. CHAR *lpszPhonebookPath,
  1059. CHAR *lpszEntryName,
  1060. CHAR *lpszRefPbkPath,
  1061. CHAR *lpszRefEntryName);
  1062. DWORD APIENTRY RasDestroyConnection (HCONN hconn);
  1063. DWORD APIENTRY RasConnectionEnum (HANDLE hConnection,
  1064. HCONN *lphconn,
  1065. LPDWORD lpdwcbConnections,
  1066. LPDWORD lpdwcConnections);
  1067. DWORD APIENTRY RasAddConnectionPort ( HCONN hconn,
  1068. HPORT hport,
  1069. DWORD dwSubEntry);
  1070. DWORD APIENTRY RasEnumConnectionPorts ( HANDLE hConnection,
  1071. HCONN hconn,
  1072. RASMAN_PORT *pPorts,
  1073. LPDWORD lpdwcbPorts,
  1074. LPDWORD lpdwcPorts);
  1075. DWORD APIENTRY RasGetConnectionParams ( HCONN hconn,
  1076. PRAS_CONNECTIONPARAMS pConnectionParams);
  1077. DWORD APIENTRY RasSetConnectionParams ( HCONN hconn,
  1078. PRAS_CONNECTIONPARAMS pConnectionParams);
  1079. DWORD APIENTRY RasGetConnectionUserData ( HPORT hconn,
  1080. DWORD dwTag,
  1081. PBYTE pBuf,
  1082. LPDWORD lpdwcbBuf);
  1083. DWORD APIENTRY RasSetConnectionUserData ( HPORT hconn,
  1084. DWORD dwTag,
  1085. PBYTE pBuf,
  1086. DWORD dwcbBuf);
  1087. DWORD APIENTRY RasGetPortUserData ( HPORT hport,
  1088. DWORD dwTag,
  1089. PBYTE pBuf,
  1090. LPDWORD lpdwcbBuf);
  1091. DWORD APIENTRY RasSetPortUserData ( HPORT hport,
  1092. DWORD dwTag,
  1093. PBYTE pBuf,
  1094. DWORD dwcbBuf);
  1095. DWORD APIENTRY RasAddNotification ( HCONN hconn,
  1096. HANDLE hevent,
  1097. DWORD dwfFlags);
  1098. DWORD APIENTRY RasSignalNewConnection( HCONN hconn);
  1099. DWORD APIENTRY RasSetDevConfig( HPORT hport,
  1100. PCHAR devicetype,
  1101. PBYTE config,
  1102. DWORD size);
  1103. DWORD APIENTRY RasGetDevConfig( HANDLE hConnection,
  1104. HPORT hport,
  1105. PCHAR devicetype,
  1106. PBYTE config,
  1107. DWORD* size);
  1108. DWORD APIENTRY RasGetTimeSinceLastActivity( HPORT hport,
  1109. LPDWORD lpdwTimeSinceLastActivity );
  1110. DWORD APIENTRY RasBundleGetStatistics( HANDLE,
  1111. HPORT,
  1112. PBYTE,
  1113. PDWORD);
  1114. DWORD APIENTRY RasBundleGetStatisticsEx( HANDLE,
  1115. HPORT,
  1116. PBYTE,
  1117. PDWORD);
  1118. DWORD APIENTRY RasBundleClearStatistics(HANDLE,
  1119. HPORT);
  1120. DWORD APIENTRY RasBundleClearStatisticsEx(HANDLE,
  1121. HCONN);
  1122. DWORD APIENTRY RasPnPControl( DWORD,
  1123. HPORT);
  1124. DWORD APIENTRY RasSetIoCompletionPort( HPORT,
  1125. HANDLE,
  1126. PRAS_OVERLAPPED,
  1127. PRAS_OVERLAPPED,
  1128. PRAS_OVERLAPPED,
  1129. PRAS_OVERLAPPED);
  1130. DWORD APIENTRY RasSetRouterUsage( HPORT,
  1131. BOOL);
  1132. DWORD APIENTRY RasServerPortClose( HPORT );
  1133. DWORD APIENTRY RasSetRasdialInfo( HPORT,
  1134. CHAR *,
  1135. CHAR *,
  1136. CHAR *,
  1137. DWORD,
  1138. PBYTE);
  1139. DWORD APIENTRY RasSendPppMessageToRasman( HPORT,
  1140. LPBYTE);
  1141. DWORD APIENTRY RasGetNumPortOpen ();
  1142. // DWORD APIENTRY RasNotifyConfigChange();
  1143. DWORD _RasmanInit( LPDWORD pNumPorts);
  1144. VOID _RasmanEngine();
  1145. DWORD APIENTRY RasRegisterPnPEvent ( HANDLE, BOOL );
  1146. DWORD APIENTRY RasRegisterPnPHandler ( PAPCFUNC,
  1147. HANDLE,
  1148. BOOL);
  1149. DWORD APIENTRY RasRpcConnect ( LPWSTR,
  1150. HANDLE *);
  1151. DWORD APIENTRY RasRpcDisconnect( HANDLE *);
  1152. DWORD APIENTRY RasRpcConnectServer(LPTSTR lpszServer,
  1153. HANDLE *pHConnection);
  1154. DWORD APIENTRY RasRpcDisconnectServer(HANDLE hConnection);
  1155. DWORD APIENTRY RasSetBapPolicy ( HCONN,
  1156. DWORD,
  1157. DWORD,
  1158. DWORD,
  1159. DWORD );
  1160. DWORD APIENTRY RasPppStarted ( HPORT hPort );
  1161. DWORD APIENTRY RasRefConnection ( HCONN hConn,
  1162. BOOL AddRef,
  1163. DWORD *pdwRefCount );
  1164. DWORD APIENTRY RasPppGetEapInfo ( HCONN hConn,
  1165. DWORD dwSubEntry,
  1166. PDWORD pdwContextId,
  1167. PDWORD pdwEapTypeId,
  1168. PDWORD pdwSizeofEapUIData,
  1169. PBYTE pbdata );
  1170. DWORD APIENTRY RasPppSetEapInfo ( HPORT hPort,
  1171. DWORD dwSizeOfEapUIdata,
  1172. DWORD dwContextId,
  1173. PBYTE pbdata);
  1174. DWORD APIENTRY RasSetDeviceConfigInfo( HANDLE hConnection,
  1175. DWORD cDevices,
  1176. DWORD cbBuffer,
  1177. BYTE *pbBuffer);
  1178. DWORD APIENTRY RasGetDeviceConfigInfo( HANDLE hConnection,
  1179. DWORD *dwVersion,
  1180. DWORD *pcDevices,
  1181. DWORD *pcbdata,
  1182. BYTE *pbBuffer);
  1183. DWORD APIENTRY RasFindPrerequisiteEntry(
  1184. HCONN hConn,
  1185. HCONN *phConnPrerequisiteEntry);
  1186. DWORD APIENTRY RasPortOpenEx(CHAR *pszDeviceName,
  1187. DWORD dwDeviceLineCounter,
  1188. HPORT *phport,
  1189. HANDLE hnotifier,
  1190. DWORD *pdwFlags);
  1191. DWORD APIENTRY RasLinkGetStatistics( HANDLE hConnection,
  1192. HCONN hConn,
  1193. DWORD dwSubEntry,
  1194. PBYTE pbStats);
  1195. DWORD APIENTRY RasConnectionGetStatistics(HANDLE hConnection,
  1196. HCONN hConn,
  1197. PBYTE pbStats);
  1198. DWORD APIENTRY RasGetHportFromConnection(HANDLE hConnection,
  1199. HCONN hConn,
  1200. HPORT *phport);
  1201. DWORD APIENTRY RasReferenceCustomCount(HCONN hConn,
  1202. BOOL fAddref,
  1203. CHAR* pszPhonebookPath,
  1204. CHAR* pszEntryName,
  1205. DWORD* pdwCount);
  1206. DWORD APIENTRY RasGetHConnFromEntry(HCONN *phConn,
  1207. CHAR *pszPhonebookPath,
  1208. CHAR *pszEntryName);
  1209. DWORD APIENTRY RasGetConnectInfo(
  1210. HPORT hPort,
  1211. DWORD *pdwSize,
  1212. RAS_CONNECT_INFO *pConnectInfo
  1213. );
  1214. DWORD APIENTRY RasGetDeviceName(
  1215. RASDEVICETYPE eDeviceType,
  1216. CHAR *pszDeviceName
  1217. );
  1218. DWORD APIENTRY RasGetCalledIdInfo(
  1219. HANDLE hConneciton,
  1220. RAS_DEVICE_INFO *pDeviceInfo,
  1221. DWORD *pdwSize,
  1222. RAS_CALLEDID_INFO *pCalledIdInfo
  1223. );
  1224. DWORD APIENTRY RasSetCalledIdInfo(
  1225. HANDLE hConnection,
  1226. RAS_DEVICE_INFO *pDeviceInfo,
  1227. RAS_CALLEDID_INFO *pCalledIdInfo,
  1228. BOOL fWrite
  1229. );
  1230. DWORD APIENTRY RasEnableIpSec(HPORT hPort,
  1231. BOOL fEnable,
  1232. BOOL fServer,
  1233. RAS_L2TP_ENCRYPTION eDataEncryption
  1234. );
  1235. DWORD APIENTRY RasIsIpSecEnabled(HPORT hPort,
  1236. BOOL *pfIsIpSecEnabled);
  1237. DWORD APIENTRY RasGetEapUserInfo(HANDLE hToken,
  1238. PBYTE pbEapInfo,
  1239. DWORD *pdwInfoSize,
  1240. GUID *pGuid,
  1241. BOOL fRouter,
  1242. DWORD dwEapTypeId
  1243. );
  1244. DWORD APIENTRY RasSetEapUserInfo(HANDLE hToken,
  1245. GUID *pGuid,
  1246. PBYTE pbUserInfo,
  1247. DWORD dwInfoSize,
  1248. BOOL fClear,
  1249. BOOL fRouter,
  1250. DWORD dwEapTypeId
  1251. );
  1252. DWORD APIENTRY RasSetEapLogonInfo(HPORT hPort,
  1253. BOOL fLogon,
  1254. RASEAPINFO *pEapInfo);
  1255. DWORD APIENTRY RasSendNotification(RASEVENT *pRasEvent);
  1256. DWORD APIENTRY RasGetNdiswanDriverCaps(
  1257. HANDLE hConnection,
  1258. RAS_NDISWAN_DRIVER_INFO *pInfo);
  1259. DWORD APIENTRY RasGetBandwidthUtilization(
  1260. HPORT hPort,
  1261. RAS_GET_BANDWIDTH_UTILIZATION *pUtilization);
  1262. DWORD APIENTRY RasGetProtocolInfo(
  1263. HANDLE hConnection,
  1264. RASMAN_GET_PROTOCOL_INFO *pInfo);
  1265. BOOL IsRasmanProcess();
  1266. DWORD APIENTRY RasGetCustomScriptDll(CHAR *pszCustomDll);
  1267. DWORD DwRasGetHostByName(CHAR *pszHostName,
  1268. DWORD **ppdwAddress,
  1269. DWORD *pcAddresses);
  1270. DWORD RasIsTrustedCustomDll(
  1271. HANDLE hConnection,
  1272. WCHAR *pwszCustomDll,
  1273. BOOL *pfResult);
  1274. DWORD RasDoIke(
  1275. HANDLE hConnection,
  1276. HPORT hPort,
  1277. DWORD *pdwStatus);
  1278. #if (WINVER >= 0x501)
  1279. DWORD RasSetCommSettings(
  1280. HPORT hPort,
  1281. RASCOMMSETTINGS *pRasCommSettings,
  1282. PVOID pv);
  1283. #endif
  1284. DWORD RasEnableRasAudio(
  1285. HANDLE hConnection,
  1286. BOOL fEnable);
  1287. DWORD
  1288. RasSetKey(
  1289. HANDLE hConnection,
  1290. GUID *pGuid,
  1291. DWORD dwMask,
  1292. DWORD cbkey,
  1293. PBYTE pbkey);
  1294. DWORD
  1295. RasGetKey(
  1296. HANDLE hConnection,
  1297. GUID *pGuid,
  1298. DWORD dwMask,
  1299. DWORD *pcbkey,
  1300. PBYTE pbkey);
  1301. DWORD
  1302. RasSetAddressDisable(
  1303. WCHAR *pszAddress,
  1304. BOOL fDisable);
  1305. DWORD
  1306. RasGetDevConfigEx( HANDLE hConnection,
  1307. HPORT hport,
  1308. PCHAR devicetype,
  1309. PBYTE config,
  1310. DWORD* size);
  1311. DWORD APIENTRY
  1312. RasSendCreds(IN HPORT hport,
  1313. IN CHAR controlchar);
  1314. DWORD APIENTRY
  1315. RasGetUnicodeDeviceName(IN HPORT hport,
  1316. IN WCHAR *wszDeviceName);
  1317. DWORD APIENTRY
  1318. RasmanUninitialize();
  1319. DWORD APIENTRY
  1320. RasGetDeviceNameW(IN RASDEVICETYPE eDeviceType,
  1321. OUT WCHAR *wszDeviceName);
  1322. #endif