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.

292 lines
6.5 KiB

  1. /* Copyright (c) 1995, Microsoft Corporation, all rights reserved
  2. **
  3. ** rmutil.h
  4. ** Remote Access RASMAN utility library
  5. ** Public header
  6. **
  7. ** 06/20/95 Steve Cobb
  8. ** 12/26/95 Merge Abolade Gbadesin routines
  9. */
  10. #ifndef _RMUTIL_H_
  11. #define _RMUTIL_H_
  12. #include <rasman.h> // RAS connection manager header
  13. #include <serial.h> // RAS serial media header, for SERIAL_TXT
  14. #include <isdn.h> // RAS ISDN media header, for ISDN_TXT
  15. #include <x25.h> // RAS X.25 media header, for X25_TXT
  16. #include <rasmxs.h> // RAS modem/X.25/switch device header, for MXS_*_TXT
  17. #include <ras.h> // Win32 RAS header, for constants
  18. /* Private RASAPI32 entrypoints.
  19. */
  20. extern HPORT APIENTRY RasGetHport( HRASCONN );
  21. extern DWORD APIENTRY RasSetOldPassword( HRASCONN, CHAR* );
  22. /*----------------------------------------------------------------------------
  23. ** Constants
  24. **----------------------------------------------------------------------------
  25. */
  26. /* String translation flags.
  27. */
  28. #define XLATE_Ctrl 0x00000001
  29. #define XLATE_Cr 0x00000002
  30. #define XLATE_CrSpecial 0x00000004
  31. #define XLATE_Lf 0x00000008
  32. #define XLATE_LfSpecial 0x00000010
  33. #define XLATE_LAngle 0x00000020
  34. #define XLATE_RAngle 0x00000040
  35. #define XLATE_BSlash 0x00000080
  36. #define XLATE_SSpace 0x00000100
  37. #define XLATE_None 0
  38. #define XLATE_Diagnostic (XLATE_Ctrl)
  39. #define XLATE_ErrorResponse (XLATE_Ctrl | XLATE_LAngle | XLATE_RAngle \
  40. | XLATE_BSlash | XLATE_CrSpecial \
  41. | XLATE_LfSpecial)
  42. /*----------------------------------------------------------------------------
  43. ** Datatypes
  44. **----------------------------------------------------------------------------
  45. */
  46. struct RASDEV {
  47. HANDLE RD_Handle;
  48. DWORD RD_Flags;
  49. PTSTR RD_DeviceName;
  50. TCHAR RD_PortName[MAX_PORT_NAME + 1];
  51. TCHAR RD_DeviceType[RAS_MaxDeviceType + 1];
  52. };
  53. typedef struct RASDEV RASDEV, *PRASDEV, FAR *LPRASDEV;
  54. #define RDFLAG_DialIn 0x00000001
  55. #define RDFLAG_DialOut 0x00000002
  56. #define RDFLAG_Router 0x00000004
  57. #define RDFLAG_IsDialedIn 0x00000008
  58. #define RDFLAG_IsDialedOut 0x00000010
  59. #define RDFLAG_IsRouter 0x00000020
  60. #define RDFLAG_User1 0x80000000
  61. struct RASDEVSTATS {
  62. DWORD RDS_Condition;
  63. DWORD RDS_Flags;
  64. DWORD RDS_LineSpeed;
  65. DWORD RDS_ConnectTime;
  66. DWORD RDS_InBytes;
  67. DWORD RDS_InFrames;
  68. DWORD RDS_InCompRatio;
  69. DWORD RDS_OutBytes;
  70. DWORD RDS_OutFrames;
  71. DWORD RDS_OutCompRatio;
  72. DWORD RDS_InBytesTotal;
  73. DWORD RDS_OutBytesTotal;
  74. DWORD RDS_ErrCRC;
  75. DWORD RDS_ErrTimeout;
  76. DWORD RDS_ErrAlignment;
  77. DWORD RDS_ErrFraming;
  78. DWORD RDS_ErrHwOverruns;
  79. DWORD RDS_ErrBufOverruns;
  80. HRASCONN RDS_Hrasconn;
  81. };
  82. typedef struct RASDEVSTATS RASDEVSTATS, *PRASDEVSTATS;
  83. struct RASCONNENTRY {
  84. LIST_ENTRY RCE_Node;
  85. RASCONN *RCE_Entry;
  86. LIST_ENTRY RCE_Links;
  87. };
  88. typedef struct RASCONNENTRY RASCONNENTRY, *PRASCONNENTRY;
  89. struct RASCONNLINK {
  90. LIST_ENTRY RCL_Node;
  91. RASCONN RCL_Link;
  92. };
  93. typedef struct RASCONNLINK RASCONNLINK, *PRASCONNLINK;
  94. /*----------------------------------------------------------------------------
  95. ** Prototypes
  96. **----------------------------------------------------------------------------
  97. */
  98. DWORD
  99. ClearRasdevStats(
  100. IN RASDEV* pdev,
  101. IN BOOL fBundle );
  102. DWORD
  103. DeviceIdFromDeviceName(
  104. TCHAR* pszDeviceName );
  105. DWORD
  106. FreeRasdevTable(
  107. RASDEV* pDevTable,
  108. DWORD iDevCount );
  109. DWORD
  110. GetRasConnection0Table(
  111. OUT RAS_CONNECTION_0 ** ppRc0Table,
  112. OUT DWORD * piRc0Count );
  113. DWORD
  114. GetConnectTime(
  115. IN HRASCONN hrasconn,
  116. OUT DWORD* pdwConnectTime );
  117. DWORD
  118. GetRasconnFraming(
  119. IN HRASCONN hrasconn,
  120. OUT DWORD* pdwSendFraming,
  121. OUT DWORD* pdwRecvFraming );
  122. DWORD
  123. GetRasconnFromRasdev(
  124. IN RASDEV* pdev,
  125. OUT RASCONN** ppconn,
  126. IN RASCONN* pConnTable OPTIONAL,
  127. IN DWORD iConnCount OPTIONAL );
  128. DWORD
  129. GetRasdevBundle(
  130. IN RASDEV* pdev,
  131. OUT DWORD* pdwBundle );
  132. DWORD
  133. GetRasdevFraming(
  134. IN RASDEV* pdev,
  135. OUT DWORD* pdwFraming );
  136. DWORD
  137. GetRasdevFromRasconn(
  138. IN RASCONN* pconn,
  139. OUT RASDEV** ppdev,
  140. IN RASDEV* pDevTable OPTIONAL,
  141. IN DWORD iDevCount OPTIONAL );
  142. DWORD
  143. GetRasdevFromRasPort0(
  144. IN RAS_PORT_0* pport,
  145. OUT RASDEV** ppdev,
  146. IN RASDEV* pDevTable OPTIONAL,
  147. IN DWORD iDevCount OPTIONAL );
  148. DWORD
  149. GetRasDeviceString(
  150. IN HPORT hport,
  151. IN CHAR* pszDeviceType,
  152. IN CHAR* pszDeviceName,
  153. IN CHAR* pszKey,
  154. OUT CHAR** ppszValue,
  155. IN DWORD dwXlate );
  156. DWORD
  157. GetRasdevStats(
  158. IN RASDEV* pdev,
  159. OUT RASDEVSTATS* pstats );
  160. DWORD
  161. GetRasdevTable(
  162. OUT RASDEV** ppDevTable,
  163. OUT DWORD* piDevCount );
  164. DWORD
  165. GetRasMessage(
  166. IN HRASCONN hrasconn,
  167. OUT TCHAR** ppszMessage );
  168. DWORD
  169. GetRasPads(
  170. OUT RASMAN_DEVICE** ppDevices,
  171. OUT DWORD* pdwEntries );
  172. DWORD
  173. GetRasPort0FromRasdev(
  174. IN RASDEV* pdev,
  175. OUT RAS_PORT_0** ppport,
  176. IN RAS_PORT_0* pPortTable OPTIONAL,
  177. IN DWORD iPortCount OPTIONAL );
  178. DWORD
  179. GetRasPort0Info(
  180. IN HANDLE hPort,
  181. OUT RAS_PORT_1 * pRasPort1 );
  182. DWORD
  183. GetRasPort0Table(
  184. OUT RAS_PORT_0 ** ppPortTable,
  185. OUT DWORD * piPortCount );
  186. TCHAR *
  187. GetRasPort0UserString(
  188. IN RAS_PORT_0 * pport,
  189. IN TCHAR * pszUser );
  190. VOID
  191. GetRasPortMaxBps(
  192. IN HPORT hport,
  193. OUT DWORD* pdwMaxConnectBps,
  194. OUT DWORD* pdwMaxCarrierBps );
  195. VOID
  196. GetRasPortModemSettings(
  197. IN HPORT hport,
  198. OUT BOOL* pfHwFlowDefault,
  199. OUT BOOL* pfEcDefault,
  200. OUT BOOL* pfEccDefault );
  201. DWORD
  202. GetRasPorts(
  203. IN HANDLE hConnection,
  204. OUT RASMAN_PORT** ppPorts,
  205. OUT DWORD* pdwEntries );
  206. DWORD
  207. GetRasPortString(
  208. IN HPORT hport,
  209. IN CHAR* pszKey,
  210. OUT CHAR** ppszValue,
  211. IN DWORD dwXlate );
  212. DWORD
  213. GetRasSwitches(
  214. IN HANDLE hConnection,
  215. OUT RASMAN_DEVICE** ppDevices,
  216. OUT DWORD* pdwEntries );
  217. TCHAR*
  218. GetRasX25Diagnostic(
  219. IN HRASCONN hrasconn );
  220. BOOL
  221. IsRasdevBundled(
  222. IN RASDEV* prasdev,
  223. IN RASDEV* pDevTable,
  224. IN DWORD iDevCount );
  225. CHAR*
  226. PszFromRasValue(
  227. IN RAS_VALUE* prasvalue,
  228. IN DWORD dwXlate );
  229. DWORD
  230. RasPort0Hangup(
  231. IN HANDLE hPort );
  232. #endif // _RMUTIL_H_