Mprapi.h

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