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.

534 lines
13 KiB

  1. /*
  2. File mprapip.h
  3. Declarations for private mprapi.dll functions.
  4. 6/24/98
  5. */
  6. #ifndef __ROUTING_MPRADMINP_H__
  7. #define __ROUTING_MPRADMINP_H__
  8. #include <mprapi.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. //
  13. // Definitions of flags to be used with
  14. // MprAdminUserReadProfFlags/MprAdminUserWriteProfFlags
  15. //
  16. #define MPR_USER_PROF_FLAG_SECURE 0x1
  17. #define MPR_USER_PROF_FLAG_UNDETERMINED 0x2
  18. //
  19. // Only valid for MprAdminUserWriteProfFlags
  20. //
  21. #define MPR_USER_PROF_FLAG_FORCE_STRONG_ENCRYPTION 0x4
  22. #define MPR_USER_PROF_FLAG_FORCE_ENCRYPTION 0x8
  23. //
  24. // Definition for new information to be reported
  25. // through user parms
  26. //
  27. #define RASPRIV_DialinPolicy 0x10
  28. //
  29. // Defines the type of access a domain can give
  30. //
  31. // See MprDomainSetAccess, MprDomainQueryAccess
  32. //
  33. #define MPRFLAG_DOMAIN_NT4_SERVERS 0x1
  34. #define MPRFLAG_DOMAIN_W2K_IN_NT4_DOMAINS 0x2
  35. #define MPRFLAG_PORT_Dialin 0x1 // set ports to dialin usage
  36. #define MPRFLAG_PORT_Router 0x2 // set ports to router usage
  37. #define MPRFLAG_PORT_NonVpnDialin 0x4 // set non-vpn ports to dialin
  38. //
  39. // Flags that govern the behavior of MprPortSetUsage
  40. //
  41. #define MPRFLAG_PORT_Dialin 0x1
  42. #define MPRFLAG_PORT_Router 0x2
  43. //
  44. // Connects to a user server
  45. //
  46. DWORD WINAPI
  47. MprAdminUserServerConnect (
  48. IN PWCHAR pszMachine,
  49. IN BOOL bLocal,
  50. OUT PHANDLE phUserServer);
  51. //
  52. // Disconnects from a user server
  53. //
  54. DWORD WINAPI
  55. MprAdminUserServerDisconnect (
  56. IN HANDLE hUserServer);
  57. //
  58. // Opens the given user on the given user server
  59. //
  60. DWORD WINAPI
  61. MprAdminUserOpen (
  62. IN HANDLE hUserServer,
  63. IN PWCHAR pszUser,
  64. OUT PHANDLE phUser);
  65. //
  66. // Closes the given user
  67. //
  68. DWORD WINAPI
  69. MprAdminUserClose (
  70. IN HANDLE hUser);
  71. //
  72. // Reads in user ras-specific values
  73. //
  74. DWORD WINAPI
  75. MprAdminUserRead (
  76. IN HANDLE hUser,
  77. IN DWORD dwLevel,
  78. IN const LPBYTE pRasUser);
  79. //
  80. // Writes out user ras-specific values
  81. //
  82. DWORD WINAPI
  83. MprAdminUserWrite (
  84. IN HANDLE hUser,
  85. IN DWORD dwLevel,
  86. IN const LPBYTE pRasUser);
  87. //
  88. // Reads default profile flags
  89. //
  90. DWORD WINAPI
  91. MprAdminUserReadProfFlags(
  92. IN HANDLE hUserServer,
  93. OUT LPDWORD lpdwFlags);
  94. //
  95. // Writes default profile flags
  96. //
  97. DWORD WINAPI
  98. MprAdminUserWriteProfFlags(
  99. IN HANDLE hUserServer,
  100. IN DWORD dwFlags);
  101. //
  102. // Upgrades users from previous OS version to current.
  103. //
  104. DWORD APIENTRY
  105. MprAdminUpgradeUsers(
  106. IN PWCHAR pszServer,
  107. IN BOOL bLocal);
  108. //
  109. // Registers/Unregisters a ras server in a domain.
  110. // Must be called from context of a domain admin.
  111. //
  112. DWORD
  113. WINAPI
  114. MprDomainRegisterRasServer (
  115. IN PWCHAR pszDomain,
  116. IN PWCHAR pszMachine,
  117. IN BOOL bEnable);
  118. DWORD
  119. WINAPI
  120. MprAdminEstablishDomainRasServer (
  121. IN PWCHAR pszDomain,
  122. IN PWCHAR pszMachine,
  123. IN BOOL bEnable);
  124. DWORD
  125. WINAPI
  126. MprAdminIsDomainRasServer (
  127. IN PWCHAR pszDomain,
  128. IN PWCHAR pszMachine,
  129. OUT PBOOL pbIsRasServer);
  130. //
  131. // Determines whether the given machine is registered
  132. // in the given domain.
  133. //
  134. DWORD
  135. WINAPI
  136. MprDomainQueryRasServer (
  137. IN PWCHAR pszDomain,
  138. IN PWCHAR pszMachine,
  139. OUT PBOOL pbIsRasServer);
  140. //
  141. // Modifies the given domain with so that it yeilds the given access.
  142. //
  143. // See MPR_DOMAIN_ACCESS_* values for the flags
  144. //
  145. DWORD
  146. WINAPI
  147. MprDomainSetAccess(
  148. IN PWCHAR pszDomain,
  149. IN DWORD dwAccessFlags);
  150. //
  151. // Discovers what if any access is yeilded by the given domain.
  152. //
  153. // See MPR_DOMAIN_ACCESS_* values for the flags
  154. //
  155. DWORD
  156. WINAPI
  157. MprDomainQueryAccess(
  158. IN PWCHAR pszDomain,
  159. IN LPDWORD lpdwAccessFlags);
  160. //
  161. // Sets all port usages to the given mode. See MPRFLAG_PORT_*.
  162. // The naming convention here is intentionally private. Eventually,
  163. // there should be MprAdmin and MprConfig api's to set port usage.
  164. //
  165. DWORD
  166. APIENTRY
  167. MprPortSetUsage(
  168. IN DWORD dwModes);
  169. //
  170. // Internal credentials functions shared by mprapi.dll and rasppp.dll
  171. //
  172. DWORD APIENTRY
  173. MprAdminInterfaceSetCredentialsInternal(
  174. IN LPWSTR lpwsServer OPTIONAL,
  175. IN LPWSTR lpwsInterfaceName,
  176. IN LPWSTR lpwsUserName OPTIONAL,
  177. IN LPWSTR lpwsDomainName OPTIONAL,
  178. IN LPWSTR lpwsPassword OPTIONAL
  179. );
  180. DWORD APIENTRY
  181. MprAdminInterfaceGetCredentialsInternal(
  182. IN LPWSTR lpwsServer OPTIONAL,
  183. IN LPWSTR lpwsInterfaceName,
  184. IN LPWSTR lpwsUserName OPTIONAL,
  185. IN LPWSTR lpwsPassword OPTIONAL,
  186. IN LPWSTR lpwsDomainName OPTIONAL
  187. );
  188. //
  189. // Utilities
  190. //
  191. DWORD
  192. MprUtilGetSizeOfMultiSz(
  193. IN LPWSTR lpwsMultiSz);
  194. //
  195. // Internal on-the-wire representations of the structures exposed
  196. // in mprapi.h
  197. //
  198. typedef struct _MPRI_INTERFACE_0
  199. {
  200. IN OUT WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
  201. OUT DWORD dwInterface;
  202. IN OUT BOOL fEnabled;
  203. IN OUT ROUTER_INTERFACE_TYPE dwIfType;
  204. OUT ROUTER_CONNECTION_STATE dwConnectionState;
  205. OUT DWORD fUnReachabilityReasons;
  206. OUT DWORD dwLastError;
  207. }
  208. MPRI_INTERFACE_0, *PMPRI_INTERFACE_0;
  209. typedef struct _MPRI_INTERFACE_1
  210. {
  211. IN OUT WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
  212. OUT DWORD dwInterface;
  213. IN OUT BOOL fEnabled;
  214. IN OUT ROUTER_INTERFACE_TYPE dwIfType;
  215. OUT ROUTER_CONNECTION_STATE dwConnectionState;
  216. OUT DWORD fUnReachabilityReasons;
  217. OUT DWORD dwLastError;
  218. OUT DWORD dwDialoutHoursRestrictionOffset;
  219. }
  220. MPRI_INTERFACE_1, *PMPRI_INTERFACE_1;
  221. typedef struct _MPRI_INTERFACE_2
  222. {
  223. IN OUT WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
  224. OUT DWORD dwInterface;
  225. IN OUT BOOL fEnabled;
  226. IN OUT ROUTER_INTERFACE_TYPE dwIfType;
  227. OUT ROUTER_CONNECTION_STATE dwConnectionState;
  228. OUT DWORD fUnReachabilityReasons;
  229. OUT DWORD dwLastError;
  230. //
  231. // Demand dial-specific properties
  232. //
  233. DWORD dwfOptions;
  234. //
  235. // Location/phone number
  236. //
  237. WCHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  238. DWORD dwAlternatesOffset;
  239. //
  240. // PPP/Ip
  241. //
  242. DWORD ipaddr;
  243. DWORD ipaddrDns;
  244. DWORD ipaddrDnsAlt;
  245. DWORD ipaddrWins;
  246. DWORD ipaddrWinsAlt;
  247. //
  248. // NetProtocols
  249. //
  250. DWORD dwfNetProtocols;
  251. //
  252. // Device
  253. //
  254. WCHAR szDeviceType[ MPR_MaxDeviceType + 1 ];
  255. WCHAR szDeviceName[ MPR_MaxDeviceName + 1 ];
  256. //
  257. // X.25
  258. //
  259. WCHAR szX25PadType[ MPR_MaxPadType + 1 ];
  260. WCHAR szX25Address[ MPR_MaxX25Address + 1 ];
  261. WCHAR szX25Facilities[ MPR_MaxFacilities + 1 ];
  262. WCHAR szX25UserData[ MPR_MaxUserData + 1 ];
  263. DWORD dwChannels;
  264. //
  265. // Multilink
  266. //
  267. DWORD dwSubEntries;
  268. DWORD dwDialMode;
  269. DWORD dwDialExtraPercent;
  270. DWORD dwDialExtraSampleSeconds;
  271. DWORD dwHangUpExtraPercent;
  272. DWORD dwHangUpExtraSampleSeconds;
  273. //
  274. // Idle timeout
  275. //
  276. DWORD dwIdleDisconnectSeconds;
  277. //
  278. // Entry Type
  279. //
  280. DWORD dwType;
  281. //
  282. // EncryptionType
  283. //
  284. DWORD dwEncryptionType;
  285. //
  286. // EAP information
  287. //
  288. DWORD dwCustomAuthKey;
  289. DWORD dwCustomAuthDataSize;
  290. DWORD dwCustomAuthDataOffset;
  291. //
  292. // Guid of the connection
  293. //
  294. GUID guidId;
  295. //
  296. // Vpn Strategy
  297. //
  298. DWORD dwVpnStrategy;
  299. } MPRI_INTERFACE_2, *PMPRI_INTERFACE_2;
  300. typedef struct _RASI_PORT_0
  301. {
  302. OUT DWORD dwPort;
  303. OUT DWORD dwConnection;
  304. OUT RAS_PORT_CONDITION dwPortCondition;
  305. OUT DWORD dwTotalNumberOfCalls;
  306. OUT DWORD dwConnectDuration; // In seconds
  307. OUT WCHAR wszPortName[ MAX_PORT_NAME + 1 ];
  308. OUT WCHAR wszMediaName[ MAX_MEDIA_NAME + 1 ];
  309. OUT WCHAR wszDeviceName[ MAX_DEVICE_NAME + 1 ];
  310. OUT WCHAR wszDeviceType[ MAX_DEVICETYPE_NAME + 1 ];
  311. }
  312. RASI_PORT_0, *PRASI_PORT_0;
  313. typedef struct _RASI_PORT_1
  314. {
  315. OUT DWORD dwPort;
  316. OUT DWORD dwConnection;
  317. OUT RAS_HARDWARE_CONDITION dwHardwareCondition;
  318. OUT DWORD dwLineSpeed; // in bits/second
  319. OUT DWORD dwBytesXmited;
  320. OUT DWORD dwBytesRcved;
  321. OUT DWORD dwFramesXmited;
  322. OUT DWORD dwFramesRcved;
  323. OUT DWORD dwCrcErr;
  324. OUT DWORD dwTimeoutErr;
  325. OUT DWORD dwAlignmentErr;
  326. OUT DWORD dwHardwareOverrunErr;
  327. OUT DWORD dwFramingErr;
  328. OUT DWORD dwBufferOverrunErr;
  329. OUT DWORD dwCompressionRatioIn;
  330. OUT DWORD dwCompressionRatioOut;
  331. }
  332. RASI_PORT_1, *PRASI_PORT_1;
  333. typedef struct _RASI_CONNECTION_0
  334. {
  335. OUT DWORD dwConnection;
  336. OUT DWORD dwInterface;
  337. OUT DWORD dwConnectDuration;
  338. OUT ROUTER_INTERFACE_TYPE dwInterfaceType;
  339. OUT DWORD dwConnectionFlags;
  340. OUT WCHAR wszInterfaceName[ MAX_INTERFACE_NAME_LEN + 1 ];
  341. OUT WCHAR wszUserName[ UNLEN + 1 ];
  342. OUT WCHAR wszLogonDomain[ DNLEN + 1 ];
  343. OUT WCHAR wszRemoteComputer[ NETBIOS_NAME_LEN + 1 ];
  344. }
  345. RASI_CONNECTION_0, *PRASI_CONNECTION_0;
  346. typedef struct _RASI_CONNECTION_1
  347. {
  348. OUT DWORD dwConnection;
  349. OUT DWORD dwInterface;
  350. OUT PPP_INFO PppInfo;
  351. OUT DWORD dwBytesXmited;
  352. OUT DWORD dwBytesRcved;
  353. OUT DWORD dwFramesXmited;
  354. OUT DWORD dwFramesRcved;
  355. OUT DWORD dwCrcErr;
  356. OUT DWORD dwTimeoutErr;
  357. OUT DWORD dwAlignmentErr;
  358. OUT DWORD dwHardwareOverrunErr;
  359. OUT DWORD dwFramingErr;
  360. OUT DWORD dwBufferOverrunErr;
  361. OUT DWORD dwCompressionRatioIn;
  362. OUT DWORD dwCompressionRatioOut;
  363. }
  364. RASI_CONNECTION_1, *PRASI_CONNECTION_1;
  365. typedef struct _RASI_CONNECTION_2
  366. {
  367. OUT DWORD dwConnection;
  368. OUT WCHAR wszUserName[ UNLEN + 1 ];
  369. OUT ROUTER_INTERFACE_TYPE dwInterfaceType;
  370. OUT GUID guid;
  371. OUT PPP_INFO_2 PppInfo2;
  372. }
  373. RASI_CONNECTION_2, *PRASI_CONNECTION_2;
  374. typedef struct _MPR_CREDENTIALSEXI
  375. {
  376. DWORD dwSize;
  377. DWORD dwOffset;
  378. BYTE bData[1];
  379. } MPR_CREDENTIALSEXI, *PMPR_CREDENTIALSEXI;
  380. //
  381. // Thunking api's
  382. //
  383. typedef
  384. VOID
  385. (* MprThunk_Free_Func)(
  386. IN PVOID pvData);
  387. typedef
  388. PVOID
  389. (* MprThunk_Allocation_Func)(
  390. IN DWORD dwSize);
  391. DWORD
  392. MprThunkInterfaceFree(
  393. IN PVOID pvData,
  394. IN DWORD dwLevel);
  395. DWORD
  396. MprThunkInterface_WtoH(
  397. IN DWORD dwLevel,
  398. IN LPBYTE lpbBuffer,
  399. IN DWORD dwBufferSize,
  400. IN DWORD dwCount,
  401. IN MprThunk_Allocation_Func pAlloc,
  402. IN MprThunk_Free_Func pFree,
  403. OUT LPBYTE* lplpbBuffer);
  404. DWORD
  405. MprThunkInterface_HtoW(
  406. IN DWORD dwLevel,
  407. IN LPBYTE lpbBuffer,
  408. OUT LPBYTE* lplpbBuffer,
  409. OUT LPDWORD lpdwSize);
  410. DWORD
  411. MprThunkPort_WtoH(
  412. IN DWORD dwLevel,
  413. IN LPBYTE lpbBuffer,
  414. IN DWORD dwBufferSize,
  415. IN DWORD dwCount,
  416. IN MprThunk_Allocation_Func pAlloc,
  417. IN MprThunk_Free_Func pFree,
  418. OUT LPBYTE* lplpbBuffer);
  419. DWORD
  420. MprThunkConnection_WtoH(
  421. IN DWORD dwLevel,
  422. IN LPBYTE lpbBuffer,
  423. IN DWORD dwBufferSize,
  424. IN DWORD dwCount,
  425. IN MprThunk_Allocation_Func pAlloc,
  426. IN MprThunk_Free_Func pFree,
  427. OUT LPBYTE* lplpbBuffer);
  428. DWORD
  429. MprThunkCredentials_HtoW(
  430. IN DWORD dwLevel,
  431. IN BYTE *pBuffer,
  432. IN MprThunk_Allocation_Func pAlloc,
  433. OUT DWORD *pdwSize,
  434. OUT PBYTE *lplpbBuffer);
  435. DWORD
  436. MprThunkCredentials_WtoH(
  437. IN DWORD dwLevel,
  438. IN MPR_CREDENTIALSEXI *pBuffer,
  439. IN MprThunk_Allocation_Func pAlloc,
  440. OUT PBYTE *lplpbBuffer);
  441. PVOID
  442. MprThunkAlloc(
  443. IN DWORD dwSize);
  444. VOID
  445. MprThunkFree(
  446. IN PVOID pvData);
  447. #ifdef __cplusplus
  448. } // extern "C"
  449. #endif
  450. #endif