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.

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