xref: /reactos/sdk/include/psdk/rassapi.h (revision c2c66aff)
1*c2c66affSColin Finck #ifndef _RASSAPI_H
2*c2c66affSColin Finck #define _RASSAPI_H
3*c2c66affSColin Finck 
4*c2c66affSColin Finck #ifdef __cplusplus
5*c2c66affSColin Finck extern "C" {
6*c2c66affSColin Finck #endif
7*c2c66affSColin Finck #ifndef UNLEN
8*c2c66affSColin Finck #include <lmcons.h>
9*c2c66affSColin Finck #endif
10*c2c66affSColin Finck #define RASSAPI_MAX_PHONENUMBER_SIZE    128
11*c2c66affSColin Finck #define RASSAPI_MAX_MEDIA_NAME          16
12*c2c66affSColin Finck #define RASSAPI_MAX_PORT_NAME           16
13*c2c66affSColin Finck #define RASSAPI_MAX_DEVICE_NAME         128
14*c2c66affSColin Finck #define RASSAPI_MAX_DEVICETYPE_NAME     16
15*c2c66affSColin Finck #define RASSAPI_MAX_PARAM_KEY_SIZE      32
16*c2c66affSColin Finck #define RASPRIV_NoCallback              0x01
17*c2c66affSColin Finck #define RASPRIV_AdminSetCallback        0x02
18*c2c66affSColin Finck #define RASPRIV_CallerSetCallback       0x04
19*c2c66affSColin Finck #define RASPRIV_DialinPrivilege         0x08
20*c2c66affSColin Finck #define RASPRIV_CallbackType (RASPRIV_AdminSetCallback \
21*c2c66affSColin Finck                              | RASPRIV_CallerSetCallback \
22*c2c66affSColin Finck                              | RASPRIV_NoCallback)
23*c2c66affSColin Finck #define	RAS_MODEM_OPERATIONAL           1
24*c2c66affSColin Finck #define	RAS_MODEM_NOT_RESPONDING        2
25*c2c66affSColin Finck #define	RAS_MODEM_HARDWARE_FAILURE      3
26*c2c66affSColin Finck #define	RAS_MODEM_INCORRECT_RESPONSE    4
27*c2c66affSColin Finck #define	RAS_MODEM_UNKNOWN               5
28*c2c66affSColin Finck #define	RAS_PORT_NON_OPERATIONAL        1
29*c2c66affSColin Finck #define	RAS_PORT_DISCONNECTED           2
30*c2c66affSColin Finck #define	RAS_PORT_CALLING_BACK           3
31*c2c66affSColin Finck #define	RAS_PORT_LISTENING              4
32*c2c66affSColin Finck #define	RAS_PORT_AUTHENTICATING         5
33*c2c66affSColin Finck #define	RAS_PORT_AUTHENTICATED          6
34*c2c66affSColin Finck #define	RAS_PORT_INITIALIZING           7
35*c2c66affSColin Finck #define MEDIA_UNKNOWN                   0
36*c2c66affSColin Finck #define MEDIA_SERIAL                    1
37*c2c66affSColin Finck #define MEDIA_RAS10_SERIAL              2
38*c2c66affSColin Finck #define MEDIA_X25                       3
39*c2c66affSColin Finck #define MEDIA_ISDN                      4
40*c2c66affSColin Finck #define USER_AUTHENTICATED              0x0001
41*c2c66affSColin Finck #define MESSENGER_PRESENT               0x0002
42*c2c66affSColin Finck #define PPP_CLIENT                      0x0004
43*c2c66affSColin Finck #define GATEWAY_ACTIVE                  0x0008
44*c2c66affSColin Finck #define REMOTE_LISTEN                   0x0010
45*c2c66affSColin Finck #define PORT_MULTILINKED                0x0020
46*c2c66affSColin Finck #define RAS_IPADDRESSLEN                15
47*c2c66affSColin Finck #define RAS_IPXADDRESSLEN               22
48*c2c66affSColin Finck #define RAS_ATADDRESSLEN                32
49*c2c66affSColin Finck #define RASDOWNLEVEL                    10
50*c2c66affSColin Finck #define RASADMIN_35                     35
51*c2c66affSColin Finck #define RASADMIN_CURRENT                40
52*c2c66affSColin Finck 
53*c2c66affSColin Finck typedef ULONG IPADDR;
54*c2c66affSColin Finck typedef enum _RAS_PARAMS_FORMAT {
55*c2c66affSColin Finck     ParamNumber = 0,
56*c2c66affSColin Finck     ParamString = 1
57*c2c66affSColin Finck } RAS_PARAMS_FORMAT;
58*c2c66affSColin Finck typedef union RAS_PARAMS_VALUE {
59*c2c66affSColin Finck     DWORD Number;
60*c2c66affSColin Finck     struct {
61*c2c66affSColin Finck         DWORD Length;
62*c2c66affSColin Finck         PCHAR Data;
63*c2c66affSColin Finck     } String;
64*c2c66affSColin Finck } RAS_PARAMS_VALUE;
65*c2c66affSColin Finck typedef struct RAS_PARAMETERS {
66*c2c66affSColin Finck     CHAR                P_Key [RASSAPI_MAX_PARAM_KEY_SIZE];
67*c2c66affSColin Finck     RAS_PARAMS_FORMAT   P_Type;
68*c2c66affSColin Finck     BYTE                P_Attributes;
69*c2c66affSColin Finck     RAS_PARAMS_VALUE    P_Value;
70*c2c66affSColin Finck } RAS_PARAMETERS;
71*c2c66affSColin Finck typedef struct _RAS_USER_0 {
72*c2c66affSColin Finck     BYTE    bfPrivilege;
73*c2c66affSColin Finck     WCHAR   szPhoneNumber[RASSAPI_MAX_PHONENUMBER_SIZE + 1];
74*c2c66affSColin Finck } RAS_USER_0, *PRAS_USER_0;
75*c2c66affSColin Finck typedef struct _RAS_PORT_0 {
76*c2c66affSColin Finck     WCHAR wszPortName[RASSAPI_MAX_PORT_NAME];
77*c2c66affSColin Finck     WCHAR wszDeviceType[RASSAPI_MAX_DEVICETYPE_NAME];
78*c2c66affSColin Finck     WCHAR wszDeviceName[RASSAPI_MAX_DEVICE_NAME];
79*c2c66affSColin Finck     WCHAR wszMediaName[RASSAPI_MAX_MEDIA_NAME];
80*c2c66affSColin Finck     DWORD reserved;
81*c2c66affSColin Finck     DWORD Flags;
82*c2c66affSColin Finck     WCHAR wszUserName[UNLEN + 1];
83*c2c66affSColin Finck     WCHAR wszComputer[NETBIOS_NAME_LEN];
84*c2c66affSColin Finck     DWORD dwStartSessionTime;          /* seconds from 1/1/1970 */
85*c2c66affSColin Finck     WCHAR wszLogonDomain[DNLEN + 1];
86*c2c66affSColin Finck     BOOL fAdvancedServer;
87*c2c66affSColin Finck } RAS_PORT_0, *PRAS_PORT_0;
88*c2c66affSColin Finck typedef struct _RAS_PPP_NBFCP_RESULT {
89*c2c66affSColin Finck     DWORD dwError;
90*c2c66affSColin Finck     DWORD dwNetBiosError;
91*c2c66affSColin Finck     CHAR  szName[ NETBIOS_NAME_LEN + 1 ];
92*c2c66affSColin Finck     WCHAR wszWksta[ NETBIOS_NAME_LEN + 1 ];
93*c2c66affSColin Finck } RAS_PPP_NBFCP_RESULT;
94*c2c66affSColin Finck typedef struct _RAS_PPP_IPCP_RESULT{
95*c2c66affSColin Finck     DWORD dwError;
96*c2c66affSColin Finck     WCHAR wszAddress[ RAS_IPADDRESSLEN + 1 ];
97*c2c66affSColin Finck } RAS_PPP_IPCP_RESULT;
98*c2c66affSColin Finck typedef struct _RAS_PPP_IPXCP_RESULT {
99*c2c66affSColin Finck     DWORD dwError;
100*c2c66affSColin Finck     WCHAR wszAddress[ RAS_IPXADDRESSLEN + 1 ];
101*c2c66affSColin Finck } RAS_PPP_IPXCP_RESULT;
102*c2c66affSColin Finck typedef struct _RAS_PPP_ATCP_RESULT {
103*c2c66affSColin Finck     DWORD dwError;
104*c2c66affSColin Finck     WCHAR wszAddress[ RAS_ATADDRESSLEN + 1 ];
105*c2c66affSColin Finck } RAS_PPP_ATCP_RESULT;
106*c2c66affSColin Finck typedef struct _RAS_PPP_PROJECTION_RESULT {
107*c2c66affSColin Finck     RAS_PPP_NBFCP_RESULT nbf;
108*c2c66affSColin Finck     RAS_PPP_IPCP_RESULT  ip;
109*c2c66affSColin Finck     RAS_PPP_IPXCP_RESULT ipx;
110*c2c66affSColin Finck     RAS_PPP_ATCP_RESULT  at;
111*c2c66affSColin Finck } RAS_PPP_PROJECTION_RESULT;
112*c2c66affSColin Finck typedef struct _RAS_PORT_1{
113*c2c66affSColin Finck     RAS_PORT_0  rasport0;
114*c2c66affSColin Finck     DWORD       LineCondition;
115*c2c66affSColin Finck     DWORD       HardwareCondition;
116*c2c66affSColin Finck     DWORD       LineSpeed;
117*c2c66affSColin Finck     WORD        NumStatistics;
118*c2c66affSColin Finck     WORD        NumMediaParms;
119*c2c66affSColin Finck     DWORD       SizeMediaParms;
120*c2c66affSColin Finck     RAS_PPP_PROJECTION_RESULT  ProjResult;
121*c2c66affSColin Finck } RAS_PORT_1, *PRAS_PORT_1;
122*c2c66affSColin Finck typedef struct _RAS_PORT_STATISTICS {
123*c2c66affSColin Finck     DWORD   dwBytesXmited;
124*c2c66affSColin Finck     DWORD   dwBytesRcved;
125*c2c66affSColin Finck     DWORD   dwFramesXmited;
126*c2c66affSColin Finck     DWORD   dwFramesRcved;
127*c2c66affSColin Finck     DWORD   dwCrcErr;
128*c2c66affSColin Finck     DWORD   dwTimeoutErr;
129*c2c66affSColin Finck     DWORD   dwAlignmentErr;
130*c2c66affSColin Finck     DWORD   dwHardwareOverrunErr;
131*c2c66affSColin Finck     DWORD   dwFramingErr;
132*c2c66affSColin Finck     DWORD   dwBufferOverrunErr;
133*c2c66affSColin Finck     DWORD   dwBytesXmitedUncompressed;
134*c2c66affSColin Finck     DWORD   dwBytesRcvedUncompressed;
135*c2c66affSColin Finck     DWORD   dwBytesXmitedCompressed;
136*c2c66affSColin Finck     DWORD   dwBytesRcvedCompressed;
137*c2c66affSColin Finck     DWORD   dwPortBytesXmited;
138*c2c66affSColin Finck     DWORD   dwPortBytesRcved;
139*c2c66affSColin Finck     DWORD   dwPortFramesXmited;
140*c2c66affSColin Finck     DWORD   dwPortFramesRcved;
141*c2c66affSColin Finck     DWORD   dwPortCrcErr;
142*c2c66affSColin Finck     DWORD   dwPortTimeoutErr;
143*c2c66affSColin Finck     DWORD   dwPortAlignmentErr;
144*c2c66affSColin Finck     DWORD   dwPortHardwareOverrunErr;
145*c2c66affSColin Finck     DWORD   dwPortFramingErr;
146*c2c66affSColin Finck     DWORD   dwPortBufferOverrunErr;
147*c2c66affSColin Finck     DWORD   dwPortBytesXmitedUncompressed;
148*c2c66affSColin Finck     DWORD   dwPortBytesRcvedUncompressed;
149*c2c66affSColin Finck     DWORD   dwPortBytesXmitedCompressed;
150*c2c66affSColin Finck     DWORD   dwPortBytesRcvedCompressed;
151*c2c66affSColin Finck } RAS_PORT_STATISTICS, *PRAS_PORT_STATISTICS;
152*c2c66affSColin Finck typedef struct _RAS_SERVER_0 {
153*c2c66affSColin Finck     WORD TotalPorts;
154*c2c66affSColin Finck     WORD PortsInUse;
155*c2c66affSColin Finck     DWORD RasVersion;
156*c2c66affSColin Finck } RAS_SERVER_0, *PRAS_SERVER_0;
157*c2c66affSColin Finck 
158*c2c66affSColin Finck DWORD APIENTRY RasAdminServerGetInfo( const WCHAR*,  PRAS_SERVER_0 );
159*c2c66affSColin Finck DWORD APIENTRY RasAdminGetUserAccountServer( const WCHAR*, const WCHAR*, LPWSTR );
160*c2c66affSColin Finck DWORD APIENTRY RasAdminUserGetInfo( const WCHAR*, const WCHAR*, PRAS_USER_0 );
161*c2c66affSColin Finck DWORD APIENTRY RasAdminUserSetInfo( const WCHAR*, const WCHAR*, const PRAS_USER_0 );
162*c2c66affSColin Finck DWORD APIENTRY RasAdminPortEnum( const WCHAR*, PRAS_PORT_0*, WORD*);
163*c2c66affSColin Finck DWORD APIENTRY RasAdminPortGetInfo( const WCHAR*, const WCHAR*, RAS_PORT_1*, RAS_PORT_STATISTICS*,  RAS_PARAMETERS** );
164*c2c66affSColin Finck DWORD APIENTRY RasAdminPortClearStatistics( const WCHAR*, const WCHAR* );
165*c2c66affSColin Finck DWORD APIENTRY RasAdminPortDisconnect( const WCHAR*, const WCHAR* );
166*c2c66affSColin Finck DWORD APIENTRY RasAdminFreeBuffer(PVOID);
167*c2c66affSColin Finck DWORD APIENTRY RasAdminGetErrorString( UINT,  WCHAR*,  DWORD );
168*c2c66affSColin Finck BOOL APIENTRY RasAdminAcceptNewConnection( RAS_PORT_1*, RAS_PORT_STATISTICS*, RAS_PARAMETERS* );
169*c2c66affSColin Finck VOID APIENTRY RasAdminConnectionHangupNotification ( RAS_PORT_1*, RAS_PORT_STATISTICS*, RAS_PARAMETERS* );
170*c2c66affSColin Finck DWORD APIENTRY RasAdminGetIpAddressForUser ( WCHAR*, WCHAR*, IPADDR*, BOOL*);
171*c2c66affSColin Finck VOID APIENTRY RasAdminReleaseIpAddress ( WCHAR*, WCHAR*,IPADDR*	);
172*c2c66affSColin Finck DWORD APIENTRY RasAdminGetUserParms( WCHAR*, PRAS_USER_0 );
173*c2c66affSColin Finck DWORD APIENTRY RasAdminSetUserParms( WCHAR*, DWORD, PRAS_USER_0 );
174*c2c66affSColin Finck 
175*c2c66affSColin Finck #ifdef __cplusplus
176*c2c66affSColin Finck }
177*c2c66affSColin Finck #endif
178*c2c66affSColin Finck 
179*c2c66affSColin Finck #endif /* _RASSAPI_H */
180