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