Mprapi.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:50k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4.     mpradmin.h
  5. Abstract:
  6.     This file contains the structures, defines and function prototypes for the
  7.     following APIs:
  8.         MprAdminIsServiceRunning
  9.         MprAdminServerConnect
  10.         MprAdminServerDisconnect
  11.         MprAdminBufferFree
  12.         MprAdminPortEnum
  13.         MprAdminConnectionEnum
  14.         MprAdminPortGetInfo
  15.         MprAdminConnectionGetInfo
  16.         MprAdminPortClearStats
  17.         MprAdminPortReset
  18.         MprAdminConnectionClearStats
  19.         MprAdminPortDisconnect
  20.         MprAdminGetErrorString
  21.         MprAdminAcceptNewConnection
  22.         MprAdminAcceptNewLink
  23.         MprAdminConnectionHangupNotification
  24.         MprAdminLinkHangupNotification
  25.         MprAdminGetIpAddressForUser
  26.         MprAdminReleaseIpAddress
  27.         MprAdminInitializeDll
  28.         MprAdminTerminateDll
  29.         MprAdminAcceptNewConnection2
  30.         MprAdminConnectionHangupNotification2
  31.         MprAdminUserGetInfo
  32.         MprAdminUserSetInfo
  33.         MprAdminSendUserMessage
  34.         MprAdminGetPDCServer
  35.         MprAdminRegisterConnectionNotification
  36.         MprAdminDeregisterConnectionNotification
  37.         MprAdminIsServiceRunning
  38.         MprAdminServerConnect
  39.         MprAdminServerDisconnect
  40.         MprAdminBufferFree
  41.         MprAdminServerGetInfo
  42.         MprAdminGetErrorString
  43.         MprAdminTransportCreate
  44.         MprAdminTransportSetInfo
  45.         MprAdminTransportGetInfo
  46.         MprAdminInterfaceCreate
  47.         MprAdminInterfaceDelete
  48.         MprAdminInterfaceGetInfo
  49.         MprAdminInterfaceTransportAdd
  50.         MprAdminInterfaceTransportGetInfo
  51.         MprAdminInterfaceTransportSetInfo
  52.         MprAdminInterfaceTransportRemove
  53.         MprAdminInterfaceGetHandle
  54.         MprAdminInterfaceSetCredentials
  55.         MprAdminInterfaceGetCredentials
  56.         MprAdminInterfaceEnum
  57.         MprAdminInterfaceConnect
  58.         MprAdminInterfaceDisconnect
  59.         MprAdminInterfaceUpdateRoutes
  60.         MprAdminInterfaceQueryUpdateResult
  61.         MprAdminInterfaceUpdatePhonebookInfo
  62.         MprAdminMIBServerConnect
  63.         MprAdminMIBServerDisconnect
  64.         MprAdminMIBBufferFree
  65.         MprAdminMIBEntryCreate
  66.         MprAdminMIBEntryDelete
  67.         MprAdminMIBEntryGet
  68.         MprAdminMIBEntrySet
  69.         MprAdminMIBEntryGetFirst
  70.         MprAdminMIBEntryGetNext
  71.         MprAdminMIBSetTrapInfo
  72.         MprAdminMIBGetTrapInfo
  73.     All MIB APIs operate with the conceptual MIB row.
  74.         MprConfigServerConnect
  75.         MprConfigServerDisconnect
  76.         MprConfigBufferFree
  77.         MprConfigServerGetInfo
  78.         MprConfigServerBackup
  79.         MprConfigServerRestore
  80.         MprConfigTransportCreate
  81.         MprConfigTransportDelete
  82.         MprConfigTransportGetHandle
  83.         MprConfigTransportSetInfo
  84.         MprConfigTransportGetInfo
  85.         MprConfigTransportEnum
  86.         MprConfigInterfaceCreate
  87.         MprConfigInterfaceDelete
  88.         MprConfigInterfaceGetHandle
  89.         MprConfigInterfaceGetInfo
  90.         MprConfigInterfaceEnum
  91.         MprConfigInterfaceTransportAdd
  92.         MprConfigInterfaceTransportRemove
  93.         MprConfigInterfaceTransportGetHandle
  94.         MprConfigInterfaceTransportGetInfo
  95.         MprConfigInterfaceTransportSetInfo
  96.         MprConfigInterfaceTransportEnum
  97.         MprSetupIpInIpInterfaceFriendlyNameEnum
  98.         MprSetupIpInIpInterfaceFriendlyNameFree
  99.         MprSetupIpInIpInterfaceFriendlyNameCreate
  100.         MprSetupIpInIpInterfaceFriendlyNameDelete
  101. --*/
  102. #ifndef __ROUTING_MPRADMIN_H__
  103. #define __ROUTING_MPRADMIN_H__
  104. #if _MSC_VER > 1000
  105. #pragma once
  106. #endif
  107. #include <lmcons.h>
  108. #include <ras.h>
  109. #ifdef __cplusplus
  110. extern "C" {
  111. #endif
  112. //#if(WINVER >= 0x0403)
  113. //
  114. // Name of the Routing and RemoteAccess Service
  115. //
  116. #define RRAS_SERVICE_NAME       TEXT("RemoteAccess")
  117. //
  118. // Protocol IDs
  119. //
  120. #define PID_IPX                 0x0000002B
  121. #define PID_IP                  0x00000021
  122. #define PID_NBF                 0x0000003F
  123. #define PID_ATALK               0x00000029
  124. #define MAX_INTERFACE_NAME_LEN  256
  125. #define MAX_TRANSPORT_NAME_LEN  40
  126. #define MAX_MEDIA_NAME          16
  127. #define MAX_PORT_NAME           16
  128. #define MAX_DEVICE_NAME         128
  129. #define MAX_PHONE_NUMBER_LEN    128
  130. #define MAX_DEVICETYPE_NAME     16
  131. //
  132. // MPR Interface structures and definitions.
  133. //
  134. //
  135. // MPR Interface types
  136. //
  137. typedef enum _ROUTER_INTERFACE_TYPE
  138. {
  139.     ROUTER_IF_TYPE_CLIENT,
  140.     ROUTER_IF_TYPE_HOME_ROUTER,
  141.     ROUTER_IF_TYPE_FULL_ROUTER,
  142.     ROUTER_IF_TYPE_DEDICATED,
  143.     ROUTER_IF_TYPE_INTERNAL,
  144.     ROUTER_IF_TYPE_LOOPBACK,
  145.     ROUTER_IF_TYPE_TUNNEL1,
  146.     ROUTER_IF_TYPE_DIALOUT
  147. }
  148. ROUTER_INTERFACE_TYPE;
  149. typedef enum _ROUTER_CONNECTION_STATE
  150. {
  151.     ROUTER_IF_STATE_UNREACHABLE,
  152.     ROUTER_IF_STATE_DISCONNECTED,
  153.     ROUTER_IF_STATE_CONNECTING,
  154.     ROUTER_IF_STATE_CONNECTED
  155. }
  156. ROUTER_CONNECTION_STATE;
  157. #define MPR_INTERFACE_OUT_OF_RESOURCES              0x00000001
  158. #define MPR_INTERFACE_ADMIN_DISABLED                0x00000002
  159. #define MPR_INTERFACE_CONNECTION_FAILURE            0x00000004
  160. #define MPR_INTERFACE_SERVICE_PAUSED                0x00000008
  161. #define MPR_INTERFACE_DIALOUT_HOURS_RESTRICTION     0x00000010
  162. #define MPR_INTERFACE_NO_MEDIA_SENSE                0x00000020
  163. #define MPR_INTERFACE_NO_DEVICE                     0x00000040
  164. typedef struct _MPR_INTERFACE_0
  165. {
  166.     IN OUT  WCHAR                   wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
  167.     OUT     HANDLE                  hInterface;
  168.     IN OUT  BOOL                    fEnabled;
  169.     IN OUT  ROUTER_INTERFACE_TYPE   dwIfType;
  170.     OUT     ROUTER_CONNECTION_STATE dwConnectionState;
  171.     OUT     DWORD                   fUnReachabilityReasons;
  172.     OUT     DWORD                   dwLastError;
  173. }
  174. MPR_INTERFACE_0, *PMPR_INTERFACE_0;
  175. typedef struct _MPR_IPINIP_INTERFACE_0
  176. {
  177.     WCHAR   wszFriendlyName[MAX_INTERFACE_NAME_LEN+1];
  178.     GUID    Guid;
  179. }MPR_IPINIP_INTERFACE_0, *PMPR_IPINIP_INTERFACE_0;
  180. #if(WINVER >= 0x0500)
  181. typedef struct _MPR_INTERFACE_1
  182. {
  183.     IN OUT  WCHAR                   wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
  184.     OUT     HANDLE                  hInterface;
  185.     IN OUT  BOOL                    fEnabled;
  186.     IN OUT  ROUTER_INTERFACE_TYPE   dwIfType;
  187.     OUT     ROUTER_CONNECTION_STATE dwConnectionState;
  188.     OUT     DWORD                   fUnReachabilityReasons;
  189.     OUT     DWORD                   dwLastError;
  190.     OUT     LPWSTR                  lpwsDialoutHoursRestriction;
  191. }
  192. MPR_INTERFACE_1, *PMPR_INTERFACE_1;
  193. //
  194. // MPR_INTERFACE_2 definitions
  195. //
  196. #define MPR_MaxDeviceType     RAS_MaxDeviceType
  197. #define MPR_MaxPhoneNumber    RAS_MaxPhoneNumber
  198. #define MPR_MaxIpAddress      RAS_MaxIpAddress
  199. #define MPR_MaxIpxAddress     RAS_MaxIpxAddress
  200. #define MPR_MaxEntryName      RAS_MaxEntryName
  201. #define MPR_MaxDeviceName     RAS_MaxDeviceName
  202. #define MPR_MaxCallbackNumber RAS_MaxCallbackNumber
  203. #define MPR_MaxAreaCode       RAS_MaxAreaCode
  204. #define MPR_MaxPadType        RAS_MaxPadType
  205. #define MPR_MaxX25Address     RAS_MaxX25Address
  206. #define MPR_MaxFacilities     RAS_MaxFacilities
  207. #define MPR_MaxUserData       RAS_MaxUserData
  208. //
  209. // MPR_INTERFACE_2 'dwfOptions' bit flags.
  210. //
  211. #define MPRIO_SpecificIpAddr            RASEO_SpecificIpAddr
  212. #define MPRIO_SpecificNameServers       RASEO_SpecificNameServers
  213. #define MPRIO_IpHeaderCompression       RASEO_IpHeaderCompression
  214. #define MPRIO_RemoteDefaultGateway      RASEO_RemoteDefaultGateway
  215. #define MPRIO_DisableLcpExtensions      RASEO_DisableLcpExtensions
  216. #define MPRIO_SwCompression             RASEO_SwCompression
  217. #define MPRIO_RequireEncryptedPw        RASEO_RequireEncryptedPw
  218. #define MPRIO_RequireMsEncryptedPw      RASEO_RequireMsEncryptedPw
  219. #define MPRIO_RequireDataEncryption     RASEO_RequireDataEncryption
  220. #define MPRIO_NetworkLogon              RASEO_NetworkLogon
  221. #define MPRIO_PromoteAlternates         RASEO_PromoteAlternates
  222. #define MPRIO_SecureLocalFiles          RASEO_SecureLocalFiles
  223. #define MPRIO_RequireEAP                RASEO_RequireEAP
  224. #define MPRIO_RequirePAP                RASEO_RequirePAP
  225. #define MPRIO_RequireSPAP               RASEO_RequireSPAP
  226. #define MPRIO_SharedPhoneNumbers        RASEO_SharedPhoneNumbers
  227. #define MPRIO_RequireCHAP               RASEO_RequireCHAP
  228. #define MPRIO_RequireMsCHAP             RASEO_RequireMsCHAP
  229. #define MPRIO_RequireMsCHAP2            RASEO_RequireMsCHAP2
  230. #if (WINVER >= 0x501)
  231. #define MPRIO_IpSecPreSharedKey         0x80000000
  232. #endif
  233. //
  234. // MPR_INTERFACE_2 'dwProtocols' bit flags.
  235. //
  236. #define MPRNP_Ipx                       RASNP_Ipx
  237. #define MPRNP_Ip                        RASNP_Ip
  238. //
  239. // MPR_INTERFACE_2 'szDeviceType' default strings.
  240. //
  241. #define MPRDT_Modem                     RASDT_Modem
  242. #define MPRDT_Isdn                      RASDT_Isdn
  243. #define MPRDT_X25                       RASDT_X25
  244. #define MPRDT_Vpn                       RASDT_Vpn
  245. #define MPRDT_Pad                       RASDT_Pad
  246. #define MPRDT_Generic                   RASDT_Generic
  247. #define MPRDT_Serial         RASDT_Serial        
  248. #define MPRDT_FrameRelay                RASDT_FrameRelay
  249. #define MPRDT_Atm                       RASDT_Atm
  250. #define MPRDT_Sonet                     RASDT_Sonet
  251. #define MPRDT_SW56                      RASDT_SW56
  252. #define MPRDT_Irda                      RASDT_Irda
  253. #define MPRDT_Parallel                  RASDT_Parallel
  254. //
  255. // MPR_INTERFACE_2 'dwType' settings
  256. //
  257. #define MPRET_Phone    RASET_Phone
  258. #define MPRET_Vpn      RASET_Vpn
  259. #define MPRET_Direct   RASET_Direct
  260. //
  261. // MPR_INTERFACE_2 'dwDialMode' values.
  262. //
  263. #define MPRDM_DialFirst                0
  264. #define MPRDM_DialAll                  RASEDM_DialAll
  265. #define MPRDM_DialAsNeeded             RASEDM_DialAsNeeded
  266. //
  267. // MPR_INTERFACE_2 'dwIdleDisconnectSeconds' constants.
  268. //
  269. #define MPRIDS_Disabled                 RASIDS_Disabled
  270. #define MPRIDS_UseGlobalValue           RASIDS_UseGlobalValue
  271. //
  272. // MPR_INTERFACE_2 encryption types.
  273. //
  274. #define MPR_ET_None         ET_None         
  275. #define MPR_ET_Require      ET_Require      
  276. #define MPR_ET_RequireMax   ET_RequireMax   
  277. #define MPR_ET_Optional     ET_Optional     
  278. //
  279. // MPR_INTERFACE_2 Vpn strategies
  280. //
  281. #define MPR_VS_Default VS_Default
  282. #define MPR_VS_PptpOnly     VS_PptpOnly
  283. #define MPR_VS_PptpFirst VS_PptpFirst
  284. #define MPR_VS_L2tpOnly  VS_L2tpOnly 
  285. #define MPR_VS_L2tpFirst VS_L2tpFirst
  286. //
  287. // Used to create/get/set a demand dial interface plus its
  288. // ras configuration.
  289. //
  290. typedef struct _MPR_INTERFACE_2
  291. {
  292.     IN OUT  WCHAR                   wszInterfaceName[MAX_INTERFACE_NAME_LEN+1];
  293.     OUT     HANDLE                  hInterface;
  294.     IN OUT  BOOL                    fEnabled;
  295.     IN OUT  ROUTER_INTERFACE_TYPE   dwIfType;
  296.     OUT     ROUTER_CONNECTION_STATE dwConnectionState;
  297.     OUT     DWORD                   fUnReachabilityReasons;
  298.     OUT     DWORD                   dwLastError;
  299.     //
  300.     // Demand dial-specific properties
  301.     //
  302.     DWORD       dwfOptions;
  303.     //
  304.     // Location/phone number
  305.     //
  306.     WCHAR       szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  307.     PWCHAR      szAlternates;
  308.     //
  309.     // PPP/Ip
  310.     //
  311.     DWORD       ipaddr;
  312.     DWORD       ipaddrDns;
  313.     DWORD       ipaddrDnsAlt;
  314.     DWORD       ipaddrWins;
  315.     DWORD       ipaddrWinsAlt;
  316.     //
  317.     // NetProtocols
  318.     //
  319.     DWORD       dwfNetProtocols;
  320.     //
  321.     // Device
  322.     //
  323.     WCHAR       szDeviceType[ MPR_MaxDeviceType + 1 ];
  324.     WCHAR       szDeviceName[ MPR_MaxDeviceName + 1 ];
  325.     //
  326.     // X.25
  327.     //
  328.     WCHAR       szX25PadType[ MPR_MaxPadType + 1 ];
  329.     WCHAR       szX25Address[ MPR_MaxX25Address + 1 ];
  330.     WCHAR       szX25Facilities[ MPR_MaxFacilities + 1 ];
  331.     WCHAR       szX25UserData[ MPR_MaxUserData + 1 ];
  332.     DWORD       dwChannels;
  333.     //
  334.     // Multilink
  335.     //
  336.     DWORD       dwSubEntries;
  337.     DWORD       dwDialMode;
  338.     DWORD       dwDialExtraPercent;
  339.     DWORD       dwDialExtraSampleSeconds;
  340.     DWORD       dwHangUpExtraPercent;
  341.     DWORD       dwHangUpExtraSampleSeconds;
  342.     //
  343.     // Idle timeout
  344.     //
  345.     DWORD       dwIdleDisconnectSeconds;
  346.     //
  347.     // Entry Type
  348.     //
  349.     DWORD       dwType;
  350.     //
  351.     // EncryptionType
  352.     //
  353.     DWORD       dwEncryptionType;
  354.     //
  355.     // EAP information
  356.     //
  357.     DWORD       dwCustomAuthKey;
  358.     DWORD       dwCustomAuthDataSize;
  359.     LPBYTE      lpbCustomAuthData;
  360.     //
  361.     // Guid of the connection
  362.     //
  363.     GUID        guidId;
  364.     //
  365.     // Vpn Strategy
  366.     //
  367.     DWORD       dwVpnStrategy;
  368. } MPR_INTERFACE_2, *PMPR_INTERFACE_2;
  369. //
  370. // Used to set/get per-link information for multilinked demand
  371. // dial interfaces.
  372. //
  373. typedef struct _MPR_DEVICE_0
  374. {
  375.     //
  376.     // Device
  377.     //
  378.     WCHAR       szDeviceType[ MPR_MaxDeviceType + 1 ];
  379.     WCHAR       szDeviceName[ MPR_MaxDeviceName + 1 ];
  380. }
  381. MPR_DEVICE_0, *PMPR_DEVICE_0;
  382. typedef struct _MPR_DEVICE_1
  383. {
  384.     //
  385.     // Device
  386.     //
  387.     WCHAR       szDeviceType[ MPR_MaxDeviceType + 1 ];
  388.     WCHAR       szDeviceName[ MPR_MaxDeviceName + 1 ];
  389.     //
  390.     // Phone numbers
  391.     //
  392.     WCHAR       szLocalPhoneNumber[ MPR_MaxPhoneNumber + 1 ];
  393.     PWCHAR      szAlternates;
  394. }
  395. MPR_DEVICE_1, *PMPR_DEVICE_1;
  396. //
  397. // Used to get/set extended credentials information such as
  398. // eap credentials info.
  399. //
  400. typedef struct _MPR_CREDENTIALSEX_0
  401. {
  402.     DWORD  dwSize;
  403.     LPBYTE lpbCredentialsInfo;
  404. }
  405. MPR_CREDENTIALSEX_0, *PMPR_CREDENTIALSEX_0;
  406. typedef struct _MPR_CREDENTIALSEX_1
  407. {
  408.     DWORD  dwSize;
  409.     LPBYTE lpbCredentialsInfo;
  410. }
  411. MPR_CREDENTIALSEX_1, *PMPR_CREDENTIALSEX_1;
  412. #endif /* WINVER >= 0x0500 */
  413. typedef struct _MPR_TRANSPORT_0
  414. {
  415.     OUT     DWORD                   dwTransportId;
  416.     OUT     HANDLE                  hTransport;
  417.     OUT     WCHAR                   wszTransportName[MAX_TRANSPORT_NAME_LEN+1];
  418. }
  419. MPR_TRANSPORT_0, *PMPR_TRANSPORT_0;
  420. typedef struct _MPR_IFTRANSPORT_0
  421. {
  422.     OUT     DWORD                  dwTransportId;
  423.     OUT     HANDLE                 hIfTransport;
  424.     OUT     WCHAR                  wszIfTransportName[MAX_TRANSPORT_NAME_LEN+1];
  425. }
  426. MPR_IFTRANSPORT_0, *PMPR_IFTRANSPORT_0;
  427. typedef struct _MPR_SERVER_0
  428. {
  429.     OUT BOOL                    fLanOnlyMode;
  430.     OUT DWORD                   dwUpTime;           // In seconds
  431.     OUT DWORD                   dwTotalPorts;
  432.     OUT DWORD                   dwPortsInUse;
  433. }
  434. MPR_SERVER_0, *PMPR_SERVER_0;
  435. //
  436. // Port condition codes
  437. //
  438. typedef enum _RAS_PORT_CONDITION
  439. {
  440.     RAS_PORT_NON_OPERATIONAL,
  441.     RAS_PORT_DISCONNECTED,
  442.     RAS_PORT_CALLING_BACK,
  443.     RAS_PORT_LISTENING,
  444.     RAS_PORT_AUTHENTICATING,
  445.     RAS_PORT_AUTHENTICATED,
  446.     RAS_PORT_INITIALIZING
  447. }
  448. RAS_PORT_CONDITION;
  449. //
  450. // Hardware condition codes
  451. //
  452. typedef enum _RAS_HARDWARE_CONDITION
  453. {
  454.     RAS_HARDWARE_OPERATIONAL,
  455.     RAS_HARDWARE_FAILURE
  456. }
  457. RAS_HARDWARE_CONDITION;
  458. typedef struct _RAS_PORT_0
  459. {
  460.     OUT HANDLE                  hPort;
  461.     OUT HANDLE                  hConnection;
  462.     OUT RAS_PORT_CONDITION      dwPortCondition;
  463.     OUT DWORD                   dwTotalNumberOfCalls;
  464.     OUT DWORD                   dwConnectDuration;      // In seconds
  465.     OUT WCHAR                   wszPortName[ MAX_PORT_NAME + 1 ];
  466.     OUT WCHAR                   wszMediaName[ MAX_MEDIA_NAME + 1 ];
  467.     OUT WCHAR                   wszDeviceName[ MAX_DEVICE_NAME + 1 ];
  468.     OUT WCHAR                   wszDeviceType[ MAX_DEVICETYPE_NAME + 1 ];
  469. }
  470. RAS_PORT_0, *PRAS_PORT_0;
  471. typedef struct _RAS_PORT_1
  472. {
  473.     OUT HANDLE                  hPort;
  474.     OUT HANDLE                  hConnection;
  475.     OUT RAS_HARDWARE_CONDITION  dwHardwareCondition;
  476.     OUT DWORD                   dwLineSpeed;            // in bits/second
  477.     OUT DWORD                   dwBytesXmited;
  478.     OUT DWORD                   dwBytesRcved;
  479.     OUT DWORD                   dwFramesXmited;
  480.     OUT DWORD                   dwFramesRcved;
  481.     OUT DWORD                   dwCrcErr;
  482.     OUT DWORD                   dwTimeoutErr;
  483.     OUT DWORD                   dwAlignmentErr;
  484.     OUT DWORD                   dwHardwareOverrunErr;
  485.     OUT DWORD                   dwFramingErr;
  486.     OUT DWORD                   dwBufferOverrunErr;
  487.     OUT DWORD                   dwCompressionRatioIn;
  488.     OUT DWORD                   dwCompressionRatioOut;
  489. }
  490. RAS_PORT_1, *PRAS_PORT_1;
  491. //
  492. // Maximum length of address string, e.g. "255.255.255.255" for IP.
  493. //
  494. #define IPADDRESSLEN  15
  495. #define IPXADDRESSLEN 22
  496. #define ATADDRESSLEN  32
  497. typedef struct _PPP_NBFCP_INFO
  498. {
  499.     OUT DWORD           dwError;
  500.     OUT WCHAR           wszWksta[ NETBIOS_NAME_LEN + 1 ];
  501. }
  502. PPP_NBFCP_INFO;
  503. typedef struct _PPP_IPCP_INFO
  504. {
  505.     OUT DWORD           dwError;
  506.     OUT WCHAR           wszAddress[ IPADDRESSLEN + 1 ];
  507.     OUT WCHAR           wszRemoteAddress[ IPADDRESSLEN + 1 ];
  508. }
  509. PPP_IPCP_INFO;
  510. //
  511. // PPP_IPCP_INFO2 dwOptions values.
  512. //
  513. #define PPP_IPCP_VJ             0x00000001
  514. typedef struct _PPP_IPCP_INFO2
  515. {
  516.     OUT DWORD           dwError;
  517.     OUT WCHAR           wszAddress[ IPADDRESSLEN + 1 ];
  518.     OUT WCHAR           wszRemoteAddress[ IPADDRESSLEN + 1 ];
  519.     OUT DWORD           dwOptions;
  520.     OUT DWORD           dwRemoteOptions;
  521. }
  522. PPP_IPCP_INFO2;
  523. typedef struct _PPP_IPXCP_INFO
  524. {
  525.     OUT DWORD           dwError;
  526.     OUT WCHAR           wszAddress[ IPXADDRESSLEN + 1 ];
  527. }
  528. PPP_IPXCP_INFO;
  529. typedef struct _PPP_ATCP_INFO
  530. {
  531.     OUT DWORD           dwError;
  532.     OUT WCHAR           wszAddress[ ATADDRESSLEN + 1 ];
  533. }
  534. PPP_ATCP_INFO;
  535. typedef struct _PPP_INFO
  536. {
  537.     OUT PPP_NBFCP_INFO  nbf;
  538.     OUT PPP_IPCP_INFO   ip;
  539.     OUT PPP_IPXCP_INFO  ipx;
  540.     OUT PPP_ATCP_INFO   at;
  541. } PPP_INFO;
  542. #if(WINVER >= 0x0500)
  543. //
  544. // PPP_CCP dwCompressionAlgorithm values.
  545. //
  546. #define RASCCPCA_MPPC         0x00000006
  547. #define RASCCPCA_STAC         0x00000005
  548. //
  549. // PPP_CCP dwOptions values.
  550. //
  551. #define PPP_CCP_COMPRESSION         0x00000001
  552. #define PPP_CCP_ENCRYPTION40BITOLD  0x00000010
  553. #define PPP_CCP_ENCRYPTION40BIT     0x00000020
  554. #define PPP_CCP_ENCRYPTION128BIT    0x00000040
  555. #define PPP_CCP_ENCRYPTION56BIT     0x00000080
  556. #define PPP_CCP_HISTORYLESS         0x01000000
  557. typedef struct _PPP_CCP_INFO
  558. {
  559.     OUT DWORD           dwError;
  560.     OUT DWORD           dwCompressionAlgorithm;
  561.     OUT DWORD           dwOptions;
  562.     OUT DWORD           dwRemoteCompressionAlgorithm;
  563.     OUT DWORD           dwRemoteOptions;
  564. }
  565. PPP_CCP_INFO;
  566. //
  567. // PPP_LCP dwAuthenticatonProtocol values.
  568. //
  569. #define PPP_LCP_PAP          0xC023
  570. #define PPP_LCP_SPAP         0xC123
  571. #define PPP_LCP_CHAP         0xC223
  572. #define PPP_LCP_EAP          0xC227
  573. //
  574. // PPP_LCP dwAuthenticatonData values.
  575. //
  576. #define PPP_LCP_CHAP_MD5     0x05
  577. #define PPP_LCP_CHAP_MS      0x80
  578. #define PPP_LCP_CHAP_MSV2    0x81
  579. //
  580. // PPP_LCP dwOption values
  581. //
  582. #define PPP_LCP_MULTILINK_FRAMING   0x00000001
  583. #define PPP_LCP_PFC                 0x00000002
  584. #define PPP_LCP_ACFC                0x00000004
  585. #define PPP_LCP_SSHF                0x00000008
  586. #define PPP_LCP_DES_56              0x00000010
  587. #define PPP_LCP_3_DES               0x00000020
  588. typedef struct _PPP_LCP_INFO
  589. {
  590.     OUT DWORD dwError;
  591.     OUT DWORD dwAuthenticationProtocol;
  592.     OUT DWORD dwAuthenticationData;
  593.     OUT DWORD dwRemoteAuthenticationProtocol;
  594.     OUT DWORD dwRemoteAuthenticationData;
  595.     OUT DWORD dwTerminateReason;
  596.     OUT DWORD dwRemoteTerminateReason;
  597.     OUT DWORD dwOptions;
  598.     OUT DWORD dwRemoteOptions;
  599.     OUT DWORD dwEapTypeId;
  600.     OUT DWORD dwRemoteEapTypeId;
  601. }
  602. PPP_LCP_INFO;
  603. typedef struct _PPP_INFO_2
  604. {
  605.     OUT PPP_NBFCP_INFO  nbf;
  606.     OUT PPP_IPCP_INFO2  ip;
  607.     OUT PPP_IPXCP_INFO  ipx;
  608.     OUT PPP_ATCP_INFO   at;
  609.     OUT PPP_CCP_INFO    ccp;
  610.     OUT PPP_LCP_INFO    lcp;
  611. }
  612. PPP_INFO_2;
  613. #endif /* WINVER >= 0x0500 */
  614. //
  615. // Possible bits set in Connection Flags field
  616. //
  617. #define RAS_FLAGS_PPP_CONNECTION        0x00000001
  618. #define RAS_FLAGS_MESSENGER_PRESENT     0x00000002
  619. #if(WINVER < 0x0501)
  620. #define RAS_FLAGS_RAS_CONNECTION        0x00000004
  621. #endif
  622. typedef struct _RAS_CONNECTION_0
  623. {
  624.     OUT HANDLE                  hConnection;
  625.     OUT HANDLE                  hInterface;
  626.     OUT DWORD                   dwConnectDuration;      // In seconds
  627.     OUT ROUTER_INTERFACE_TYPE   dwInterfaceType;
  628.     OUT DWORD                   dwConnectionFlags;
  629.     OUT WCHAR                   wszInterfaceName[ MAX_INTERFACE_NAME_LEN + 1 ];
  630.     OUT WCHAR                   wszUserName[ UNLEN + 1 ];
  631.     OUT WCHAR                   wszLogonDomain[ DNLEN + 1 ];
  632.     OUT WCHAR                   wszRemoteComputer[ NETBIOS_NAME_LEN + 1 ];
  633. }
  634. RAS_CONNECTION_0, *PRAS_CONNECTION_0;
  635. typedef struct _RAS_CONNECTION_1
  636. {
  637.     OUT HANDLE                  hConnection;
  638.     OUT HANDLE                  hInterface;
  639.     OUT PPP_INFO                PppInfo;
  640.     OUT DWORD                   dwBytesXmited;
  641.     OUT DWORD                   dwBytesRcved;
  642.     OUT DWORD                   dwFramesXmited;
  643.     OUT DWORD                   dwFramesRcved;
  644.     OUT DWORD                   dwCrcErr;
  645.     OUT DWORD                   dwTimeoutErr;
  646.     OUT DWORD                   dwAlignmentErr;
  647.     OUT DWORD                   dwHardwareOverrunErr;
  648.     OUT DWORD                   dwFramingErr;
  649.     OUT DWORD                   dwBufferOverrunErr;
  650.     OUT DWORD                   dwCompressionRatioIn;
  651.     OUT DWORD                   dwCompressionRatioOut;
  652. }
  653. RAS_CONNECTION_1, *PRAS_CONNECTION_1;
  654. #if(WINVER >= 0x0500)
  655. typedef struct _RAS_CONNECTION_2
  656. {
  657.     OUT HANDLE                  hConnection;
  658.     OUT WCHAR                   wszUserName[ UNLEN + 1 ];
  659.     OUT ROUTER_INTERFACE_TYPE   dwInterfaceType;
  660.     OUT GUID                    guid;
  661.     OUT PPP_INFO_2              PppInfo2;
  662. }
  663. RAS_CONNECTION_2, *PRAS_CONNECTION_2;
  664. #endif /* WINVER >= 0x0500 */
  665. //
  666. // Structures used by the MPRADMIN USER APIs. Use level 0 to get/set this
  667. // structure.
  668. //
  669. //
  670. // Bits indicating user's Remote Access privileges and mask to isolate
  671. // call back privilege.
  672. //
  673. // Note: Bit 0 MUST represent NoCallback due to a quirk of the "userparms"
  674. //       storage method.  When a new LAN Manager user is created, bit 0 of the
  675. //       userparms field is set to 1 and all other bits are 0.  These bits are
  676. //       arranged so this "no Dial-In info" state maps to the "default Dial-In
  677. //       privilege" state.
  678. #define RASPRIV_NoCallback        0x01
  679. #define RASPRIV_AdminSetCallback  0x02
  680. #define RASPRIV_CallerSetCallback 0x04
  681. #define RASPRIV_DialinPrivilege   0x08
  682. // 
  683. // The following are flags for the bfPrivilege2 member of RAS_USER_1
  684. // structure
  685. //
  686. #define RASPRIV2_DialinPolicy      0x1  
  687. #define RASPRIV_CallbackType (RASPRIV_AdminSetCallback 
  688.                               | RASPRIV_CallerSetCallback 
  689.                               | RASPRIV_NoCallback)
  690. typedef struct _RAS_USER_0
  691. {
  692.     OUT BYTE                    bfPrivilege;
  693.     OUT WCHAR                   wszPhoneNumber[ MAX_PHONE_NUMBER_LEN + 1];
  694. }
  695. RAS_USER_0, *PRAS_USER_0;
  696. typedef struct _RAS_USER_1
  697. {
  698.     OUT BYTE                    bfPrivilege;
  699.     OUT WCHAR                   wszPhoneNumber[ MAX_PHONE_NUMBER_LEN + 1];
  700.     OUT BYTE                    bfPrivilege2;
  701. RAS_USER_1, *PRAS_USER_1;
  702. //
  703. // Used as RPC binding handle to server
  704. //
  705. typedef HANDLE RAS_SERVER_HANDLE;
  706. typedef HANDLE MPR_SERVER_HANDLE;
  707. typedef HANDLE MIB_SERVER_HANDLE;
  708. //
  709. //  RAS ADMIN APIs
  710. //
  711. DWORD APIENTRY
  712. MprAdminConnectionEnum(
  713.     IN      RAS_SERVER_HANDLE       hRasServer,
  714.     IN      DWORD                   dwLevel,
  715.     OUT     LPBYTE *                lplpbBuffer,
  716.     IN      DWORD                   dwPrefMaxLen,
  717.     OUT     LPDWORD                 lpdwEntriesRead,
  718.     OUT     LPDWORD                 lpdwTotalEntries,
  719.     IN      LPDWORD                 lpdwResumeHandle    OPTIONAL
  720. );
  721. DWORD APIENTRY
  722. MprAdminPortEnum(
  723.     IN      RAS_SERVER_HANDLE       hRasServer,
  724.     IN      DWORD                   dwLevel,
  725.     IN      HANDLE                  hConnection,
  726.     OUT     LPBYTE *                lplpbBuffer,
  727.     IN      DWORD                   dwPrefMaxLen,
  728.     OUT     LPDWORD                 lpdwEntriesRead,
  729.     OUT     LPDWORD                 lpdwTotalEntries,
  730.     IN      LPDWORD                 lpdwResumeHandle    OPTIONAL
  731. );
  732. DWORD APIENTRY
  733. MprAdminConnectionGetInfo(
  734.     IN      RAS_SERVER_HANDLE       hRasServer,
  735.     IN      DWORD                   dwLevel,
  736.     IN      HANDLE                  hConnection,
  737.     OUT     LPBYTE *                lplpbBuffer
  738. );
  739. DWORD APIENTRY
  740. MprAdminPortGetInfo(
  741.     IN      RAS_SERVER_HANDLE       hRasServer,
  742.     IN      DWORD                   dwLevel,
  743.     IN      HANDLE                  hPort,
  744.     OUT     LPBYTE *                lplpbBuffer
  745. );
  746. DWORD APIENTRY
  747. MprAdminConnectionClearStats(
  748.     IN      RAS_SERVER_HANDLE       hRasServer,
  749.     IN      HANDLE                  hConnection
  750. );
  751. DWORD APIENTRY
  752. MprAdminPortClearStats(
  753.     IN      RAS_SERVER_HANDLE       hRasServer,
  754.     IN      HANDLE                  hPort
  755. );
  756. DWORD APIENTRY
  757. MprAdminPortReset(
  758.     IN      RAS_SERVER_HANDLE       hRasServer,
  759.     IN      HANDLE                  hPort
  760. );
  761. DWORD APIENTRY
  762. MprAdminPortDisconnect(
  763.     IN      RAS_SERVER_HANDLE       hRasServer,
  764.     IN      HANDLE                  hPort
  765. );
  766. BOOL APIENTRY
  767. MprAdminAcceptNewConnection(
  768.     IN      RAS_CONNECTION_0 *      pRasConnection0,
  769.     IN      RAS_CONNECTION_1 *      pRasConnection1
  770.     );
  771. #if(WINVER >= 0x0500)
  772. BOOL APIENTRY
  773. MprAdminAcceptNewConnection2(
  774.     IN      RAS_CONNECTION_0 *      pRasConnection0,
  775.     IN      RAS_CONNECTION_1 *      pRasConnection1,
  776.     IN      RAS_CONNECTION_2 *      pRasConnection2
  777.     );
  778. #endif /* WINVER >= 0x0500 */
  779. BOOL APIENTRY
  780. MprAdminAcceptNewLink (
  781.     IN      RAS_PORT_0 *            pRasPort0,
  782.     IN      RAS_PORT_1 *            pRasPort1
  783.     );
  784. VOID APIENTRY
  785. MprAdminConnectionHangupNotification(
  786.     IN      RAS_CONNECTION_0 *      pRasConnection0,
  787.     IN      RAS_CONNECTION_1 *      pRasConnection1
  788.     );
  789. #if(WINVER >= 0x0500)
  790. VOID APIENTRY
  791. MprAdminConnectionHangupNotification2(
  792.     IN      RAS_CONNECTION_0 *      pRasConnection0,
  793.     IN      RAS_CONNECTION_1 *      pRasConnection1,
  794.     IN      RAS_CONNECTION_2 *      pRasConnection2
  795.     );
  796. #endif /* WINVER >= 0x0500 */
  797. VOID APIENTRY
  798. MprAdminLinkHangupNotification (
  799.     IN      RAS_PORT_0 *            pRasPort0,
  800.     IN      RAS_PORT_1 *            pRasPort1
  801.     );
  802. DWORD APIENTRY
  803. MprAdminGetIpAddressForUser (
  804.     IN      WCHAR *                 lpwszUserName,
  805.     IN      WCHAR *                 lpwszPortName,
  806.     IN OUT  DWORD *                 lpdwIpAddress,
  807.     OUT     BOOL *                  bNotifyRelease
  808.     );
  809. VOID APIENTRY
  810. MprAdminReleaseIpAddress (
  811.     IN      WCHAR *                 lpszUserName,
  812.     IN      WCHAR *                 lpszPortName,
  813.     IN      DWORD *                 lpdwIpAddress
  814.     );
  815. #if(WINVER >= 0x0500)
  816. DWORD APIENTRY
  817. MprAdminInitializeDll(
  818.     VOID
  819. );
  820. DWORD APIENTRY
  821. MprAdminTerminateDll(
  822.     VOID
  823. );
  824. #endif
  825. //
  826. // MprAdminUser APIs
  827. //
  828. DWORD APIENTRY
  829. MprAdminUserGetInfo(
  830.     IN      const WCHAR *           lpszServer,
  831.     IN      const WCHAR *           lpszUser,
  832.     IN      DWORD                   dwLevel,
  833.     OUT     LPBYTE                  lpbBuffer
  834. );
  835. DWORD APIENTRY
  836. MprAdminUserSetInfo(
  837.     IN      const WCHAR *           lpszServer,
  838.     IN      const WCHAR *           lpszUser,
  839.     IN      DWORD                   dwLevel,
  840.     IN      const LPBYTE            lpbBuffer
  841. );
  842. #if(WINVER >= 0x0500)
  843. DWORD APIENTRY
  844. MprAdminSendUserMessage(
  845.     IN      MPR_SERVER_HANDLE       hMprServer,
  846.     IN      HANDLE                  hConnection,
  847.     IN      LPWSTR                  lpwszMessage
  848. );
  849. #endif /* WINVER >= 0x0500 */
  850. DWORD APIENTRY
  851. MprAdminGetPDCServer(
  852.     IN      const WCHAR *           lpszDomain,
  853.     IN      const WCHAR *           lpszServer,
  854.     OUT     LPWSTR                  lpszPDCServer
  855. );
  856. //
  857. // Router APIs
  858. //
  859. BOOL APIENTRY
  860. MprAdminIsServiceRunning(
  861.     IN  LPWSTR  lpwsServerName
  862. );
  863. DWORD APIENTRY
  864. MprAdminServerConnect(
  865.     IN      LPWSTR                  lpwsServerName      OPTIONAL,
  866.     OUT     MPR_SERVER_HANDLE *     phMprServer
  867. );
  868. VOID APIENTRY
  869. MprAdminServerDisconnect(
  870.     IN      MPR_SERVER_HANDLE       hMprServer
  871. );
  872. #if (WINVER >= 0x501)
  873. DWORD APIENTRY
  874. MprAdminServerGetCredentials(
  875.         IN  MPR_SERVER_HANDLE       hMprServer,
  876.         IN  DWORD                   dwLevel,
  877.         IN  LPBYTE *                lplpbBuffer
  878. );
  879. DWORD APIENTRY
  880. MprAdminServerSetCredentials(
  881.     IN      MPR_SERVER_HANDLE       hMprServer,
  882.     IN      DWORD                   dwLevel,
  883.     IN      LPBYTE                  lpbBuffer
  884. );
  885. #endif
  886. DWORD APIENTRY
  887. MprAdminBufferFree(
  888.     IN      LPVOID                  pBuffer
  889. );
  890. DWORD APIENTRY
  891. MprAdminGetErrorString(
  892.     IN      DWORD                   dwError,
  893.     OUT     LPWSTR *                lpwsErrorString
  894. );
  895. DWORD APIENTRY
  896. MprAdminServerGetInfo(
  897.     IN      MPR_SERVER_HANDLE       hMprServer,
  898.     IN      DWORD                   dwLevel,
  899.     OUT     LPBYTE *                lplpbBuffer
  900. );
  901. #if(WINVER >= 0x0500)
  902. DWORD APIENTRY
  903. MprAdminTransportCreate(
  904.     IN      MPR_SERVER_HANDLE       hMprServer,
  905.     IN      DWORD                   dwTransportId,
  906.     IN      LPWSTR                  lpwsTransportName           OPTIONAL,
  907.     IN      LPBYTE                  pGlobalInfo,
  908.     IN      DWORD                   dwGlobalInfoSize,
  909.     IN      LPBYTE                  pClientInterfaceInfo        OPTIONAL,
  910.     IN      DWORD                   dwClientInterfaceInfoSize   OPTIONAL,
  911.     IN      LPWSTR                  lpwsDLLPath
  912. );
  913. #endif /* WINVER >= 0x0500 */
  914. DWORD APIENTRY
  915. MprAdminTransportSetInfo(
  916.     IN      MPR_SERVER_HANDLE       hMprServer,
  917.     IN      DWORD                   dwTransportId,
  918.     IN      LPBYTE                  pGlobalInfo                 OPTIONAL,
  919.     IN      DWORD                   dwGlobalInfoSize,
  920.     IN      LPBYTE                  pClientInterfaceInfo        OPTIONAL,
  921.     IN      DWORD                   dwClientInterfaceInfoSize
  922. );
  923. DWORD APIENTRY
  924. MprAdminTransportGetInfo(
  925.     IN      MPR_SERVER_HANDLE       hMprServer,
  926.     IN      DWORD                   dwTransportId,
  927.     OUT     LPBYTE *                ppGlobalInfo                OPTIONAL,
  928.     OUT     LPDWORD                 lpdwGlobalInfoSize          OPTIONAL,
  929.     OUT     LPBYTE *                ppClientInterfaceInfo       OPTIONAL,
  930.     OUT     LPDWORD                 lpdwClientInterfaceInfoSize OPTIONAL
  931. );
  932. #if(WINVER >= 0x0500)
  933. DWORD APIENTRY
  934. MprAdminDeviceEnum(
  935.     IN      MPR_SERVER_HANDLE       hMprServer,
  936.     IN      DWORD                   dwLevel,
  937.     OUT     LPBYTE*                 lplpbBuffer,
  938.     OUT     LPDWORD                 lpdwTotalEntries);
  939. #endif /* WINVER >= 0x0500 */
  940. DWORD APIENTRY
  941. MprAdminInterfaceGetHandle(
  942.     IN      MPR_SERVER_HANDLE       hMprServer,
  943.     IN      LPWSTR                  lpwsInterfaceName,
  944.     OUT     HANDLE *                phInterface,
  945.     IN      BOOL                    fIncludeClientInterfaces
  946. );
  947. DWORD APIENTRY
  948. MprAdminInterfaceCreate(
  949.     IN      MPR_SERVER_HANDLE       hMprServer,
  950.     IN      DWORD                   dwLevel,
  951.     IN      LPBYTE                  lpbBuffer,
  952.     OUT     HANDLE *                phInterface
  953. );
  954. DWORD APIENTRY
  955. MprAdminInterfaceGetInfo(
  956.     IN      MPR_SERVER_HANDLE       hMprServer,
  957.     IN      HANDLE                  hInterface,
  958.     IN      DWORD                   dwLevel,
  959.     IN      LPBYTE *                lplpbBuffer
  960. );
  961. DWORD APIENTRY
  962. MprAdminInterfaceSetInfo(
  963.     IN      MPR_SERVER_HANDLE       hMprServer,
  964.     IN      HANDLE                  hInterface,
  965.     IN      DWORD                   dwLevel,
  966.     IN      LPBYTE                  lpbBuffer
  967. );
  968. DWORD APIENTRY
  969. MprAdminInterfaceDelete(
  970.     IN      MPR_SERVER_HANDLE       hMprServer,
  971.     IN      HANDLE                  hInterface
  972. );
  973. #if(WINVER >= 0x0500)
  974. DWORD APIENTRY
  975. MprAdminInterfaceDeviceGetInfo(
  976.     IN      MPR_SERVER_HANDLE       hMprServer,
  977.     IN      HANDLE                  hInterface,
  978.     IN      DWORD                   dwIndex,
  979.     IN      DWORD                   dwLevel,
  980.     OUT     LPBYTE*                 lplpBuffer
  981. );
  982. DWORD APIENTRY
  983. MprAdminInterfaceDeviceSetInfo(
  984.     IN      MPR_SERVER_HANDLE       hMprServer,
  985.     IN      HANDLE                  hInterface,
  986.     IN      DWORD                   dwIndex,
  987.     IN      DWORD                   dwLevel,
  988.     IN      LPBYTE                  lplpBuffer
  989. );
  990. #endif /* WINVER >= 0x0500 */
  991. DWORD APIENTRY
  992. MprAdminInterfaceTransportRemove(
  993.     IN      MPR_SERVER_HANDLE       hMprServer,
  994.     IN      HANDLE                  hInterface,
  995.     IN      DWORD                   dwTransportId
  996. );
  997. DWORD APIENTRY
  998. MprAdminInterfaceTransportAdd(
  999.     IN      MPR_SERVER_HANDLE       hMprServer,
  1000.     IN      HANDLE                  hInterface,
  1001.     IN      DWORD                   dwTransportId,
  1002.     IN      LPBYTE                  pInterfaceInfo,
  1003.     IN      DWORD                   dwInterfaceInfoSize
  1004. );
  1005. DWORD APIENTRY
  1006. MprAdminInterfaceTransportGetInfo(
  1007.     IN      MPR_SERVER_HANDLE       hMprServer,
  1008.     IN      HANDLE                  hInterface,
  1009.     IN      DWORD                   dwTransportId,
  1010.     OUT     LPBYTE *                ppInterfaceInfo,
  1011.     OUT     LPDWORD                 lpdwpInterfaceInfoSize  OPTIONAL
  1012. );
  1013. DWORD APIENTRY
  1014. MprAdminInterfaceTransportSetInfo(
  1015.     IN      MPR_SERVER_HANDLE       hMprServer,
  1016.     IN      HANDLE                  hInterface,
  1017.     IN      DWORD                   dwTransportId,
  1018.     IN      LPBYTE                  pInterfaceInfo,
  1019.     IN      DWORD                   dwInterfaceInfoSize
  1020. );
  1021. DWORD APIENTRY
  1022. MprAdminInterfaceEnum(
  1023.     IN      MPR_SERVER_HANDLE       hMprServer,
  1024.     IN      DWORD                   dwLevel,
  1025.     OUT     LPBYTE *                lplpbBuffer,
  1026.     IN      DWORD                   dwPrefMaxLen,
  1027.     OUT     LPDWORD                 lpdwEntriesRead,
  1028.     OUT     LPDWORD                 lpdwTotalEntries,
  1029.     IN      LPDWORD                 lpdwResumeHandle        OPTIONAL
  1030. );
  1031. DWORD APIENTRY
  1032. MprSetupIpInIpInterfaceFriendlyNameEnum(
  1033.     IN  PWCHAR  pwszMachineName,
  1034.     OUT LPBYTE* lplpBuffer,
  1035.     OUT LPDWORD lpdwEntriesRead
  1036.     );
  1037. DWORD APIENTRY
  1038. MprSetupIpInIpInterfaceFriendlyNameFree(
  1039.     IN  LPVOID  lpBuffer
  1040.     );
  1041. DWORD APIENTRY
  1042. MprSetupIpInIpInterfaceFriendlyNameCreate(
  1043.     PWCHAR                  pwszMachineName,
  1044.     PMPR_IPINIP_INTERFACE_0 pNameInformation
  1045.     );
  1046. DWORD APIENTRY
  1047. MprSetupIpInIpInterfaceFriendlyNameDelete(
  1048.     IN  PWCHAR  pwszMachineName,
  1049.     IN  GUID    *pGuid
  1050.     );
  1051. DWORD APIENTRY
  1052. MprAdminInterfaceSetCredentials(
  1053.     IN      LPWSTR                  lpwsServer              OPTIONAL,
  1054.     IN      LPWSTR                  lpwsInterfaceName,
  1055.     IN      LPWSTR                  lpwsUserName            OPTIONAL,
  1056.     IN      LPWSTR                  lpwsDomainName          OPTIONAL,
  1057.     IN      LPWSTR                  lpwsPassword            OPTIONAL
  1058. );
  1059. DWORD APIENTRY
  1060. MprAdminInterfaceGetCredentials(
  1061.     IN      LPWSTR                  lpwsServer              OPTIONAL,
  1062.     IN      LPWSTR                  lpwsInterfaceName,
  1063.     OUT     LPWSTR                  lpwsUserName            OPTIONAL,
  1064.     OUT     LPWSTR                  lpwsPassword            OPTIONAL,
  1065.     OUT     LPWSTR                  lpwsDomainName          OPTIONAL
  1066. );
  1067. #if(WINVER >= 0x0500)
  1068. DWORD APIENTRY
  1069. MprAdminInterfaceSetCredentialsEx(
  1070.     IN      MPR_SERVER_HANDLE       hMprServer,
  1071.     IN      HANDLE                  hInterface,
  1072.     IN      DWORD                   dwLevel,
  1073.     IN      LPBYTE                  lpbBuffer
  1074. );
  1075. DWORD APIENTRY
  1076. MprAdminInterfaceGetCredentialsEx(
  1077.     IN      MPR_SERVER_HANDLE       hMprServer,
  1078.     IN      HANDLE                  hInterface,
  1079.     IN      DWORD                   dwLevel,
  1080.     OUT     LPBYTE *                lplpbBuffer
  1081. );
  1082. #endif /* WINVER >= 0x0500 */
  1083. DWORD APIENTRY
  1084. MprAdminInterfaceConnect(
  1085.     IN      MPR_SERVER_HANDLE       hMprServer,
  1086.     IN      HANDLE                  hInterface,
  1087.     IN      HANDLE                  hEvent,
  1088.     IN      BOOL                    fSynchronous
  1089. );
  1090. DWORD APIENTRY
  1091. MprAdminInterfaceDisconnect(
  1092.     IN      MPR_SERVER_HANDLE       hMprServer,
  1093.     IN      HANDLE                  hInterface
  1094. );
  1095. DWORD APIENTRY
  1096. MprAdminInterfaceUpdateRoutes(
  1097.     IN      MPR_SERVER_HANDLE       hMprServer,
  1098.     IN      HANDLE                  hInterface,
  1099.     IN      DWORD                   dwProtocolId,
  1100.     IN      HANDLE                  hEvent
  1101. );
  1102. DWORD APIENTRY
  1103. MprAdminInterfaceQueryUpdateResult(
  1104.     IN      MPR_SERVER_HANDLE       hMprServer,
  1105.     IN      HANDLE                  hInterface,
  1106.     IN      DWORD                   dwProtocolId,
  1107.     OUT     LPDWORD                 lpdwUpdateResult
  1108. );
  1109. DWORD APIENTRY
  1110. MprAdminInterfaceUpdatePhonebookInfo(
  1111.     IN      MPR_SERVER_HANDLE       hMprServer,
  1112.     IN      HANDLE                  hInterface
  1113. );
  1114. #if(WINVER >= 0x0500)
  1115. DWORD APIENTRY
  1116. MprAdminRegisterConnectionNotification(
  1117.     IN      MPR_SERVER_HANDLE       hMprServer,
  1118.     IN      HANDLE                  hEventNotification
  1119. );
  1120. DWORD APIENTRY
  1121. MprAdminDeregisterConnectionNotification(
  1122.     IN      MPR_SERVER_HANDLE       hMprServer,
  1123.     IN      HANDLE                  hEventNotification
  1124. );
  1125. #endif /* WINVER >= 0x0500 */
  1126. //
  1127. // MIB APIs
  1128. //
  1129. DWORD APIENTRY
  1130. MprAdminMIBServerConnect(
  1131.     IN      LPWSTR                  lpwsServerName      OPTIONAL,
  1132.     OUT     MIB_SERVER_HANDLE *     phMibServer
  1133. );
  1134. VOID APIENTRY
  1135. MprAdminMIBServerDisconnect(
  1136.     IN      MIB_SERVER_HANDLE       hMibServer
  1137. );
  1138. DWORD APIENTRY
  1139. MprAdminMIBEntryCreate(
  1140.     IN      MIB_SERVER_HANDLE       hMibServer,
  1141.     IN      DWORD                   dwPid,
  1142.     IN      DWORD                   dwRoutingPid,
  1143.     IN      LPVOID                  lpEntry,
  1144.     IN      DWORD                   dwEntrySize
  1145. );
  1146. DWORD APIENTRY
  1147. MprAdminMIBEntryDelete(
  1148.     IN      MIB_SERVER_HANDLE       hMibServer,
  1149.     IN      DWORD                   dwProtocolId,
  1150.     IN      DWORD                   dwRoutingPid,
  1151.     IN      LPVOID                  lpEntry,
  1152.     IN      DWORD                   dwEntrySize
  1153. );
  1154. DWORD APIENTRY
  1155. MprAdminMIBEntrySet(
  1156.     IN      MIB_SERVER_HANDLE       hMibServer,
  1157.     IN      DWORD                   dwProtocolId,
  1158.     IN      DWORD                   dwRoutingPid,
  1159.     IN      LPVOID                  lpEntry,
  1160.     IN      DWORD                   dwEntrySize
  1161. );
  1162. DWORD APIENTRY
  1163. MprAdminMIBEntryGet(
  1164.     IN      MIB_SERVER_HANDLE       hMibServer,
  1165.     IN      DWORD                   dwProtocolId,
  1166.     IN      DWORD                   dwRoutingPid,
  1167.     IN      LPVOID                  lpInEntry,
  1168.     IN      DWORD                   dwInEntrySize,
  1169.     OUT     LPVOID*                 lplpOutEntry,
  1170.     OUT     LPDWORD                 lpOutEntrySize
  1171. );
  1172. DWORD APIENTRY
  1173. MprAdminMIBEntryGetFirst(
  1174.     IN      MIB_SERVER_HANDLE       hMibServer,
  1175.     IN      DWORD                   dwProtocolId,
  1176.     IN      DWORD                   dwRoutingPid,
  1177.     IN      LPVOID                  lpInEntry,
  1178.     IN      DWORD                   dwInEntrySize,
  1179.     OUT     LPVOID*                 lplpOutEntry,
  1180.     OUT     LPDWORD                 lpOutEntrySize
  1181. );
  1182. DWORD APIENTRY
  1183. MprAdminMIBEntryGetNext(
  1184.     IN      MIB_SERVER_HANDLE       hMibServer,
  1185.     IN      DWORD                   dwProtocolId,
  1186.     IN      DWORD                   dwRoutingPid,
  1187.     IN      LPVOID                  lpInEntry,
  1188.     IN      DWORD                   dwInEntrySize,
  1189.     OUT     LPVOID*                 lplpOutEntry,
  1190.     OUT     LPDWORD                 lpOutEntrySize
  1191. );
  1192. DWORD APIENTRY
  1193. MprAdminMIBGetTrapInfo(
  1194.     IN      MIB_SERVER_HANDLE       hMibServer,
  1195.     IN      DWORD                   dwProtocolId,
  1196.     IN      DWORD                   dwRoutingPid,
  1197.     IN      LPVOID                  lpInData,
  1198.     IN      DWORD                   dwInDataSize,
  1199.     OUT     LPVOID*                 lplpOutData,
  1200.     IN OUT  LPDWORD                 lpOutDataSize
  1201. );
  1202. DWORD APIENTRY
  1203. MprAdminMIBSetTrapInfo(
  1204.     IN      DWORD                   dwProtocolId,
  1205.     IN      DWORD                   dwRoutingPid,
  1206.     IN      HANDLE                  hEvent,
  1207.     IN      LPVOID                  lpInData,
  1208.     IN      DWORD                   dwInDataSize,
  1209.     OUT     LPVOID*                 lplpOutData,
  1210.     IN OUT  LPDWORD                 lpOutDataSize
  1211. );
  1212. DWORD APIENTRY
  1213. MprAdminMIBBufferFree(
  1214.     IN      LPVOID                  pBuffer
  1215. );
  1216. //
  1217. // Configuration APIs
  1218. //
  1219. DWORD APIENTRY
  1220. MprConfigServerInstall(
  1221.     IN      DWORD                   dwLevel,
  1222.     IN      PVOID                   pBuffer
  1223. );
  1224. DWORD APIENTRY
  1225. MprConfigServerConnect(
  1226.     IN      LPWSTR                  lpwsServerName,
  1227.     OUT     HANDLE*                 phMprConfig
  1228. );
  1229. VOID APIENTRY
  1230. MprConfigServerDisconnect(
  1231.     IN      HANDLE                  hMprConfig
  1232. );
  1233. DWORD APIENTRY
  1234. MprConfigServerRefresh(
  1235.     IN      HANDLE                  hMprConfig
  1236.     );
  1237. DWORD APIENTRY
  1238. MprConfigBufferFree(
  1239.     IN      LPVOID                  pBuffer
  1240. );
  1241. DWORD APIENTRY
  1242. MprConfigServerGetInfo(
  1243.     IN      HANDLE                  hMprConfig,
  1244.     IN      DWORD                   dwLevel,
  1245.     OUT     LPBYTE *                lplpbBuffer
  1246. );
  1247. DWORD APIENTRY
  1248. MprConfigServerBackup(
  1249.     IN      HANDLE                  hMprConfig,
  1250.     IN      LPWSTR                  lpwsPath
  1251. );
  1252. DWORD APIENTRY
  1253. MprConfigServerRestore(
  1254.     IN      HANDLE                  hMprConfig,
  1255.     IN      LPWSTR                  lpwsPath
  1256. );
  1257. DWORD APIENTRY
  1258. MprConfigTransportCreate(
  1259.     IN      HANDLE                  hMprConfig,
  1260.     IN      DWORD                   dwTransportId,
  1261.     IN      LPWSTR                  lpwsTransportName           OPTIONAL,
  1262.     IN      LPBYTE                  pGlobalInfo,
  1263.     IN      DWORD                   dwGlobalInfoSize,
  1264.     IN      LPBYTE                  pClientInterfaceInfo        OPTIONAL,
  1265.     IN      DWORD                   dwClientInterfaceInfoSize   OPTIONAL,
  1266.     IN      LPWSTR                  lpwsDLLPath,
  1267.     OUT     HANDLE*                 phRouterTransport
  1268. );
  1269. DWORD APIENTRY
  1270. MprConfigTransportDelete(
  1271.     IN      HANDLE                  hMprConfig,
  1272.     IN      HANDLE                  hRouterTransport
  1273. );
  1274. DWORD APIENTRY
  1275. MprConfigTransportGetHandle(
  1276.     IN      HANDLE                  hMprConfig,
  1277.     IN      DWORD                   dwTransportId,
  1278.     OUT     HANDLE*                 phRouterTransport
  1279. );
  1280. DWORD APIENTRY
  1281. MprConfigTransportSetInfo(
  1282.     IN      HANDLE                  hMprConfig,
  1283.     IN      HANDLE                  hRouterTransport,
  1284.     IN      LPBYTE                  pGlobalInfo                 OPTIONAL,
  1285.     IN      DWORD                   dwGlobalInfoSize            OPTIONAL,
  1286.     IN      LPBYTE                  pClientInterfaceInfo        OPTIONAL,
  1287.     IN      DWORD                   dwClientInterfaceInfoSize   OPTIONAL,
  1288.     IN      LPWSTR                  lpwsDLLPath                 OPTIONAL
  1289. );
  1290. DWORD APIENTRY
  1291. MprConfigTransportGetInfo(
  1292.     IN      HANDLE                  hMprConfig,
  1293.     IN      HANDLE                  hRouterTransport,
  1294.     IN  OUT LPBYTE*                 ppGlobalInfo                OPTIONAL,
  1295.     OUT     LPDWORD                 lpdwGlobalInfoSize          OPTIONAL,
  1296.     IN  OUT LPBYTE*                 ppClientInterfaceInfo       OPTIONAL,
  1297.     OUT     LPDWORD                 lpdwClientInterfaceInfoSize OPTIONAL,
  1298.     IN  OUT LPWSTR*                 lplpwsDLLPath               OPTIONAL
  1299. );
  1300. DWORD APIENTRY
  1301. MprConfigTransportEnum(
  1302.     IN      HANDLE                  hMprConfig,
  1303.     IN      DWORD                   dwLevel,
  1304.     IN  OUT LPBYTE*                 lplpBuffer,
  1305.     IN      DWORD                   dwPrefMaxLen,
  1306.     OUT     LPDWORD                 lpdwEntriesRead,
  1307.     OUT     LPDWORD                 lpdwTotalEntries,
  1308.     IN  OUT LPDWORD                 lpdwResumeHandle            OPTIONAL
  1309. );
  1310. DWORD APIENTRY
  1311. MprConfigInterfaceCreate(
  1312.     IN      HANDLE                  hMprConfig,
  1313.     IN      DWORD                   dwLevel,
  1314.     IN      LPBYTE                  lpbBuffer,
  1315.     OUT     HANDLE*                 phRouterInterface
  1316. );
  1317. DWORD APIENTRY
  1318. MprConfigInterfaceDelete(
  1319.     IN      HANDLE                  hMprConfig,
  1320.     IN      HANDLE                  hRouterInterface
  1321. );
  1322. DWORD APIENTRY
  1323. MprConfigInterfaceGetHandle(
  1324.     IN      HANDLE                  hMprConfig,
  1325.     IN      LPWSTR                  lpwsInterfaceName,
  1326.     OUT     HANDLE*                 phRouterInterface
  1327. );
  1328. DWORD APIENTRY
  1329. MprConfigInterfaceGetInfo(
  1330.     IN      HANDLE                  hMprConfig,
  1331.     IN      HANDLE                  hRouterInterface,
  1332.     IN      DWORD                   dwLevel,
  1333.     IN  OUT LPBYTE*                 lplpBuffer,
  1334.     OUT     LPDWORD                 lpdwBufferSize
  1335. );
  1336. DWORD APIENTRY
  1337. MprConfigInterfaceSetInfo(
  1338.     IN      HANDLE                  hMprConfig,
  1339.     IN      HANDLE                  hRouterInterface,
  1340.     IN      DWORD                   dwLevel,
  1341.     IN      LPBYTE                  lpbBuffer
  1342. );
  1343. DWORD APIENTRY
  1344. MprConfigInterfaceEnum(
  1345.     IN      HANDLE                  hMprConfig,
  1346.     IN      DWORD                   dwLevel,
  1347.     IN  OUT LPBYTE*                 lplpBuffer,
  1348.     IN      DWORD                   dwPrefMaxLen,
  1349.     OUT     LPDWORD                 lpdwEntriesRead,
  1350.     OUT     LPDWORD                 lpdwTotalEntries,
  1351.     IN  OUT LPDWORD                 lpdwResumeHandle            OPTIONAL
  1352. );
  1353. DWORD APIENTRY
  1354. MprConfigInterfaceTransportAdd(
  1355.     IN      HANDLE                  hMprConfig,
  1356.     IN      HANDLE                  hRouterInterface,
  1357.     IN      DWORD                   dwTransportId,
  1358.     IN      LPWSTR                  lpwsTransportName           OPTIONAL,
  1359.     IN      LPBYTE                  pInterfaceInfo,
  1360.     IN      DWORD                   dwInterfaceInfoSize,
  1361.     OUT     HANDLE*                 phRouterIfTransport
  1362. );
  1363. DWORD APIENTRY
  1364. MprConfigInterfaceTransportRemove(
  1365.     IN      HANDLE                  hMprConfig,
  1366.     IN      HANDLE                  hRouterInterface,
  1367.     IN      HANDLE                  hRouterIfTransport
  1368. );
  1369. DWORD APIENTRY
  1370. MprConfigInterfaceTransportGetHandle(
  1371.     IN      HANDLE                  hMprConfig,
  1372.     IN      HANDLE                  hRouterInterface,
  1373.     IN      DWORD                   dwTransportId,
  1374.     OUT     HANDLE*                 phRouterIfTransport
  1375. );
  1376. DWORD APIENTRY
  1377. MprConfigInterfaceTransportGetInfo(
  1378.     IN      HANDLE                  hMprConfig,
  1379.     IN      HANDLE                  hRouterInterface,
  1380.     IN      HANDLE                  hRouterIfTransport,
  1381.     IN  OUT LPBYTE*                 ppInterfaceInfo             OPTIONAL,
  1382.     OUT     LPDWORD                 lpdwInterfaceInfoSize       OPTIONAL
  1383. );
  1384. DWORD APIENTRY
  1385. MprConfigInterfaceTransportSetInfo(
  1386.     IN      HANDLE                  hMprConfig,
  1387.     IN      HANDLE                  hRouterInterface,
  1388.     IN      HANDLE                  hRouterIfTransport,
  1389.     IN      LPBYTE                  pInterfaceInfo              OPTIONAL,
  1390.     IN      DWORD                   dwInterfaceInfoSize         OPTIONAL
  1391. );
  1392. DWORD APIENTRY
  1393. MprConfigInterfaceTransportEnum(
  1394.     IN      HANDLE                  hMprConfig,
  1395.     IN      HANDLE                  hRouterInterface,
  1396.     IN      DWORD                   dwLevel,
  1397.     IN  OUT LPBYTE*                 lplpBuffer,     // MPR_IFTRANSPORT_0
  1398.     IN      DWORD                   dwPrefMaxLen,
  1399.     OUT     LPDWORD                 lpdwEntriesRead,
  1400.     OUT     LPDWORD                 lpdwTotalEntries,
  1401.     IN  OUT LPDWORD                 lpdwResumeHandle            OPTIONAL
  1402. );
  1403. DWORD APIENTRY
  1404. MprConfigGetFriendlyName(
  1405.     IN      HANDLE                  hMprConfig,
  1406.     IN      PWCHAR                  pszGuidName,
  1407.     OUT     PWCHAR                  pszBuffer,
  1408.     IN      DWORD                   dwBufferSize);
  1409. DWORD APIENTRY
  1410. MprConfigGetGuidName(
  1411.     IN      HANDLE                  hMprConfig,
  1412.     IN      PWCHAR                  pszFriendlyName,
  1413.     OUT     PWCHAR                  pszBuffer,
  1414.     IN      DWORD                   dwBufferSize);
  1415. //
  1416. // Information block APIs
  1417. //
  1418. DWORD APIENTRY
  1419. MprInfoCreate(
  1420.     IN      DWORD                   dwVersion,
  1421.     OUT     LPVOID*                 lplpNewHeader
  1422. );
  1423. DWORD APIENTRY
  1424. MprInfoDelete(
  1425.     IN      LPVOID                  lpHeader
  1426. );
  1427. DWORD APIENTRY
  1428. MprInfoRemoveAll(
  1429.     IN      LPVOID                  lpHeader,
  1430.     OUT     LPVOID*                 lplpNewHeader
  1431. );
  1432. DWORD APIENTRY
  1433. MprInfoDuplicate(
  1434.     IN      LPVOID                  lpHeader,
  1435.     OUT     LPVOID*                 lplpNewHeader
  1436. );
  1437. DWORD APIENTRY
  1438. MprInfoBlockAdd(
  1439.     IN      LPVOID                  lpHeader,
  1440.     IN      DWORD                   dwInfoType,
  1441.     IN      DWORD                   dwItemSize,
  1442.     IN      DWORD                   dwItemCount,
  1443.     IN      LPBYTE                  lpItemData,
  1444.     OUT     LPVOID*                 lplpNewHeader
  1445. );
  1446. DWORD APIENTRY
  1447. MprInfoBlockRemove(
  1448.     IN      LPVOID                  lpHeader,
  1449.     IN      DWORD                   dwInfoType,
  1450.     OUT     LPVOID*                 lplpNewHeader
  1451. );
  1452. DWORD APIENTRY
  1453. MprInfoBlockSet(
  1454.     IN      LPVOID                  lpHeader,
  1455.     IN      DWORD                   dwInfoType,
  1456.     IN      DWORD                   dwItemSize,
  1457.     IN      DWORD                   dwItemCount,
  1458.     IN      LPBYTE                  lpItemData,
  1459.     OUT     LPVOID*                 lplpNewHeader
  1460. );
  1461. DWORD APIENTRY
  1462. MprInfoBlockFind(
  1463.     IN      LPVOID                  lpHeader,
  1464.     IN      DWORD                   dwInfoType,
  1465.     OUT     LPDWORD                 lpdwItemSize,       // OPTIONAL
  1466.     OUT     LPDWORD                 lpdwItemCount,      // OPTIONAL
  1467.     OUT     LPBYTE*                 lplpItemData        // OPTIONAL
  1468. );
  1469. DWORD APIENTRY
  1470. MprInfoBlockQuerySize(
  1471.     IN      LPVOID                  lpHeader
  1472. );
  1473. //
  1474. // BOOL APIENTRY
  1475. // MprInfoBlockExists(
  1476. //     IN      LPVOID                  lpHeader,
  1477. //     IN      DWORD                   dwInfoType
  1478. // );
  1479. //
  1480. #define MprInfoBlockExists(h,t) 
  1481.     (MprInfoBlockFind((h),(t),NULL,NULL,NULL) == NO_ERROR)
  1482. #ifdef __cplusplus
  1483. }
  1484. #endif
  1485. //#endif /* WINVER >= 0x0403 */
  1486. #endif // __ROUTING_MPRADMIN_H__