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.

279 lines
5.4 KiB

  1. /*++
  2. Copyright (C) 1994-98 Microsft Corporation. All rights reserved.
  3. Module Name:
  4. rasapip.h
  5. Abstract:
  6. This file has definitions for private apis for ras connections.
  7. These apis are exported from rasapi32.dll
  8. Author:
  9. Rao Salapaka (raos) 30-Jan-1998
  10. Revision History:
  11. --*/
  12. #ifndef _RASAPIP_
  13. #define _RASAPIP_
  14. #include <windef.h> //for MAX_PATH
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #define RASAPIP_MAX_DEVICE_NAME 128
  19. #define RASAPIP_MAX_ENTRY_NAME 256
  20. #define RASAPIP_MAX_PHONE_NUMBER 128 // Must be same as RAS_MaxPhoneNumber
  21. #define RAS_DEVICE_TYPE(_x) ((_x) & 0x0000FFFF)
  22. #define RAS_DEVICE_CLASS(_x) ((_x) & 0xFFFF0000)
  23. enum _RASDEVICETYPE
  24. {
  25. RDT_Modem = 0,
  26. RDT_X25,
  27. RDT_Isdn,
  28. RDT_Serial,
  29. RDT_FrameRelay,
  30. RDT_Atm,
  31. RDT_Sonet,
  32. RDT_Sw56,
  33. RDT_Tunnel_Pptp,
  34. RDT_Tunnel_L2tp,
  35. RDT_Irda,
  36. RDT_Parallel,
  37. RDT_Other,
  38. RDT_PPPoE,
  39. //
  40. // The following flags when set
  41. // specify the class of the device
  42. //
  43. RDT_Tunnel = 0x00010000,
  44. RDT_Direct = 0x00020000,
  45. RDT_Null_Modem = 0x00040000,
  46. RDT_Broadband = 0x00080000
  47. };
  48. typedef enum _RASDEVICETYPE RASDEVICETYPE;
  49. // Private flags for RASENUMENTRYDETAILS
  50. //
  51. #define REED_F_Default 0x1 // default Internet connection
  52. typedef struct _RASENUMENTRYDETAILS
  53. {
  54. DWORD dwSize;
  55. DWORD dwFlags; // same as RASENTRYNAME.dwFlags
  56. DWORD dwType; // same as RASENTRY.dwType
  57. GUID guidId; // same as RASENTRY.guidId
  58. BOOL fShowMonitorIconInTaskBar; // same as RASENTRY.fShowMonitorIconInTaskBar
  59. RASDEVICETYPE rdt;
  60. WCHAR szDeviceName[RASAPIP_MAX_DEVICE_NAME];
  61. WCHAR szEntryName[RASAPIP_MAX_ENTRY_NAME + 1];
  62. WCHAR szPhonebookPath[MAX_PATH + 1];
  63. DWORD dwFlagsPriv; // Private flags, not found in RASENTRY
  64. WCHAR szPhoneNumber[RASAPIP_MAX_PHONE_NUMBER + 1];
  65. } RASENUMENTRYDETAILS, *LPRASENUMENTRYDETAILS;
  66. DWORD
  67. APIENTRY
  68. DwDeleteSubEntry(
  69. IN LPCWSTR lpszPhonebook,
  70. IN LPCWSTR lpszEntry,
  71. IN DWORD dwSubEntryId
  72. );
  73. DWORD
  74. APIENTRY
  75. DwEnumEntryDetails (
  76. IN LPCWSTR lpszPhonebookPath,
  77. OUT LPRASENUMENTRYDETAILS lprasentryname,
  78. IN OUT LPDWORD lpcb,
  79. OUT LPDWORD lpcEntries
  80. );
  81. DWORD
  82. APIENTRY
  83. DwCloneEntry(
  84. IN LPCWSTR lpwszPhonebookPath,
  85. IN LPCWSTR lpwszSrcEntryName,
  86. IN LPCWSTR lpwszDstEntryName
  87. );
  88. // Implemented in rasman.dll
  89. //
  90. DWORD
  91. APIENTRY
  92. RasReferenceRasman (
  93. IN BOOL fAttach
  94. );
  95. DWORD
  96. APIENTRY RasInitialize () ;
  97. // Implemented in netcfgx.dll
  98. //
  99. HRESULT
  100. WINAPI
  101. RasAddBindings (
  102. IN OUT UINT* pcIpOut,
  103. IN OUT UINT* pcNbfIn,
  104. IN OUT UINT* pcNbfOut);
  105. HRESULT
  106. WINAPI
  107. RasCountBindings (
  108. OUT UINT* pcIpOut,
  109. OUT UINT* pcNbfIn,
  110. OUT UINT* pcNbfOut);
  111. HRESULT
  112. WINAPI
  113. RasRemoveBindings (
  114. IN OUT UINT* pcIpOutBindings,
  115. IN const GUID* pguidIpOutBindings,
  116. IN OUT UINT* pcNbfIn,
  117. IN OUT UINT* pcNbfOut);
  118. //+---------------------------------------------------------------------------
  119. // RAS Event notifications into netman.
  120. //
  121. typedef enum _RASEVENTTYPE
  122. {
  123. ENTRY_ADDED,
  124. ENTRY_DELETED,
  125. ENTRY_MODIFIED,
  126. ENTRY_RENAMED,
  127. ENTRY_CONNECTED,
  128. ENTRY_CONNECTING,
  129. ENTRY_DISCONNECTING,
  130. ENTRY_DISCONNECTED,
  131. INCOMING_CONNECTED,
  132. INCOMING_DISCONNECTED,
  133. SERVICE_EVENT,
  134. ENTRY_BANDWIDTH_ADDED,
  135. ENTRY_BANDWIDTH_REMOVED,
  136. DEVICE_ADDED,
  137. DEVICE_REMOVED,
  138. ENTRY_AUTODIAL
  139. } RASEVENTTYPE;
  140. typedef enum _SERVICEEVENTTYPE
  141. {
  142. RAS_SERVICE_STARTED,
  143. RAS_SERVICE_STOPPED,
  144. } SERVICEEVENTTYPE;
  145. typedef enum _RASSERVICE
  146. {
  147. RASMAN,
  148. RASAUTO,
  149. REMOTEACCESS,
  150. } RASSERVICE;
  151. typedef struct _RASEVENT
  152. {
  153. RASEVENTTYPE Type;
  154. union
  155. {
  156. // ENTRY_ADDED,
  157. // ENTRY_MODIFIED,
  158. // ENTRY_CONNECTED
  159. // ENTRY_CONNECTING
  160. // ENTRY_DISCONNECTING
  161. // ENTRY_DISCONNECTED
  162. struct
  163. {
  164. RASENUMENTRYDETAILS Details;
  165. };
  166. // ENTRY_DELETED,
  167. // INCOMING_CONNECTED,
  168. // INCOMING_DISCONNECTED,
  169. // ENTRY_BANDWIDTH_ADDED
  170. // ENTRY_BANDWIDTH_REMOVED
  171. // guidId is valid
  172. // ENTRY_RENAMED
  173. // ENTRY_AUTODIAL,
  174. struct
  175. {
  176. HANDLE hConnection;
  177. RASDEVICETYPE rDeviceType;
  178. GUID guidId;
  179. WCHAR pszwNewName [RASAPIP_MAX_ENTRY_NAME + 1];
  180. };
  181. // SERVICE_EVENT,
  182. struct
  183. {
  184. SERVICEEVENTTYPE Event;
  185. RASSERVICE Service;
  186. };
  187. // DEVICE_ADDED
  188. // DEVICE_REMOVED
  189. RASDEVICETYPE DeviceType;
  190. };
  191. } RASEVENT;
  192. typedef struct _RASENTRYHEADER
  193. {
  194. DWORD dwEntryType;
  195. WCHAR szEntryName[RASAPIP_MAX_ENTRY_NAME + 1];
  196. } RASENTRYHEADER, *PRASENTRYHEADER;
  197. // Implemented in netman.dll
  198. //
  199. typedef VOID (APIENTRY *RASEVENTNOTIFYPROC)(const RASEVENT* pEvent);
  200. VOID
  201. APIENTRY
  202. RasEventNotify (
  203. const RASEVENT* pEvent);
  204. DWORD
  205. APIENTRY
  206. DwEnumEntriesForAllUsers(
  207. DWORD *lpcb,
  208. DWORD *lpcEntries,
  209. RASENTRYHEADER * pRasEntryHeader);
  210. #ifdef __cplusplus
  211. }
  212. #endif
  213. #endif // _RASAPIP_