[1166] | 1 | /**
|
---|
| 2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
| 3 | * This file is part of the mingw-w64 runtime package.
|
---|
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
| 5 | */
|
---|
| 6 | #ifndef _RASSAPI_H_
|
---|
| 7 | #define _RASSAPI_H_
|
---|
| 8 |
|
---|
| 9 | #ifdef __cplusplus
|
---|
| 10 | extern "C" {
|
---|
| 11 | #endif
|
---|
| 12 |
|
---|
| 13 | #if 1
|
---|
| 14 |
|
---|
| 15 | #ifndef UNLEN
|
---|
| 16 | #include <lmcons.h>
|
---|
| 17 | #endif
|
---|
| 18 |
|
---|
| 19 | #define RASSAPI_MAX_PHONENUMBER_SIZE 128
|
---|
| 20 | #define RASSAPI_MAX_MEDIA_NAME 16
|
---|
| 21 | #define RASSAPI_MAX_PORT_NAME 16
|
---|
| 22 | #define RASSAPI_MAX_DEVICE_NAME 128
|
---|
| 23 | #define RASSAPI_MAX_DEVICETYPE_NAME 16
|
---|
| 24 | #define RASSAPI_MAX_PARAM_KEY_SIZE 32
|
---|
| 25 |
|
---|
| 26 | #define RASPRIV_NoCallback 0x01
|
---|
| 27 | #define RASPRIV_AdminSetCallback 0x02
|
---|
| 28 | #define RASPRIV_CallerSetCallback 0x04
|
---|
| 29 | #define RASPRIV_DialinPrivilege 0x08
|
---|
| 30 |
|
---|
| 31 | #define RASPRIV_CallbackType (RASPRIV_AdminSetCallback | RASPRIV_CallerSetCallback | RASPRIV_NoCallback)
|
---|
| 32 |
|
---|
| 33 | #define RAS_MODEM_OPERATIONAL 1
|
---|
| 34 | #define RAS_MODEM_NOT_RESPONDING 2
|
---|
| 35 | #define RAS_MODEM_HARDWARE_FAILURE 3
|
---|
| 36 | #define RAS_MODEM_INCORRECT_RESPONSE 4
|
---|
| 37 | #define RAS_MODEM_UNKNOWN 5
|
---|
| 38 |
|
---|
| 39 | #define RAS_PORT_NON_OPERATIONAL 1
|
---|
| 40 | #define RAS_PORT_DISCONNECTED 2
|
---|
| 41 | #define RAS_PORT_CALLING_BACK 3
|
---|
| 42 | #define RAS_PORT_LISTENING 4
|
---|
| 43 | #define RAS_PORT_AUTHENTICATING 5
|
---|
| 44 | #define RAS_PORT_AUTHENTICATED 6
|
---|
| 45 | #define RAS_PORT_INITIALIZING 7
|
---|
| 46 |
|
---|
| 47 | enum RAS_PARAMS_FORMAT {
|
---|
| 48 | ParamNumber = 0,ParamString = 1
|
---|
| 49 | };
|
---|
| 50 | typedef enum RAS_PARAMS_FORMAT RAS_PARAMS_FORMAT;
|
---|
| 51 |
|
---|
| 52 | union RAS_PARAMS_VALUE {
|
---|
| 53 | DWORD Number;
|
---|
| 54 | struct {
|
---|
| 55 | DWORD Length;
|
---|
| 56 | PCHAR Data;
|
---|
| 57 | } String;
|
---|
| 58 | };
|
---|
| 59 | typedef union RAS_PARAMS_VALUE RAS_PARAMS_VALUE;
|
---|
| 60 |
|
---|
| 61 | struct RAS_PARAMETERS {
|
---|
| 62 | CHAR P_Key[RASSAPI_MAX_PARAM_KEY_SIZE];
|
---|
| 63 | RAS_PARAMS_FORMAT P_Type;
|
---|
| 64 | BYTE P_Attributes;
|
---|
| 65 | RAS_PARAMS_VALUE P_Value;
|
---|
| 66 | };
|
---|
| 67 | typedef struct RAS_PARAMETERS RAS_PARAMETERS;
|
---|
| 68 |
|
---|
| 69 | typedef struct _RAS_USER_0 {
|
---|
| 70 | BYTE bfPrivilege;
|
---|
| 71 | WCHAR szPhoneNumber[RASSAPI_MAX_PHONENUMBER_SIZE + 1];
|
---|
| 72 | } RAS_USER_0,*PRAS_USER_0;
|
---|
| 73 |
|
---|
| 74 | typedef struct _RAS_PORT_0 {
|
---|
| 75 | WCHAR wszPortName[RASSAPI_MAX_PORT_NAME];
|
---|
| 76 | WCHAR wszDeviceType[RASSAPI_MAX_DEVICETYPE_NAME];
|
---|
| 77 | WCHAR wszDeviceName[RASSAPI_MAX_DEVICE_NAME];
|
---|
| 78 | WCHAR wszMediaName[RASSAPI_MAX_MEDIA_NAME];
|
---|
| 79 | DWORD reserved;
|
---|
| 80 | DWORD Flags;
|
---|
| 81 | WCHAR wszUserName[UNLEN + 1];
|
---|
| 82 | WCHAR wszComputer[NETBIOS_NAME_LEN];
|
---|
| 83 | DWORD dwStartSessionTime;
|
---|
| 84 | WCHAR wszLogonDomain[DNLEN + 1];
|
---|
| 85 | WINBOOL fAdvancedServer;
|
---|
| 86 | } RAS_PORT_0,*PRAS_PORT_0;
|
---|
| 87 |
|
---|
| 88 | #define MEDIA_UNKNOWN 0
|
---|
| 89 | #define MEDIA_SERIAL 1
|
---|
| 90 | #define MEDIA_RAS10_SERIAL 2
|
---|
| 91 | #define MEDIA_X25 3
|
---|
| 92 | #define MEDIA_ISDN 4
|
---|
| 93 |
|
---|
| 94 | #define USER_AUTHENTICATED 0x0001
|
---|
| 95 | #define MESSENGER_PRESENT 0x0002
|
---|
| 96 | #define PPP_CLIENT 0x0004
|
---|
| 97 | #define GATEWAY_ACTIVE 0x0008
|
---|
| 98 | #define REMOTE_LISTEN 0x0010
|
---|
| 99 | #define PORT_MULTILINKED 0x0020
|
---|
| 100 |
|
---|
| 101 | typedef ULONG IPADDR;
|
---|
| 102 |
|
---|
| 103 | #define RAS_IPADDRESSLEN 15
|
---|
| 104 | #define RAS_IPXADDRESSLEN 22
|
---|
| 105 | #define RAS_ATADDRESSLEN 32
|
---|
| 106 |
|
---|
| 107 | typedef struct _RAS_PPP_NBFCP_RESULT {
|
---|
| 108 | DWORD dwError;
|
---|
| 109 | DWORD dwNetBiosError;
|
---|
| 110 | CHAR szName[NETBIOS_NAME_LEN + 1];
|
---|
| 111 | WCHAR wszWksta[NETBIOS_NAME_LEN + 1];
|
---|
| 112 | } RAS_PPP_NBFCP_RESULT;
|
---|
| 113 |
|
---|
| 114 | typedef struct _RAS_PPP_IPCP_RESULT {
|
---|
| 115 | DWORD dwError;
|
---|
| 116 | WCHAR wszAddress[RAS_IPADDRESSLEN + 1];
|
---|
| 117 | } RAS_PPP_IPCP_RESULT;
|
---|
| 118 |
|
---|
| 119 | typedef struct _RAS_PPP_IPXCP_RESULT {
|
---|
| 120 | DWORD dwError;
|
---|
| 121 | WCHAR wszAddress[RAS_IPXADDRESSLEN + 1];
|
---|
| 122 | } RAS_PPP_IPXCP_RESULT;
|
---|
| 123 |
|
---|
| 124 | typedef struct _RAS_PPP_ATCP_RESULT {
|
---|
| 125 | DWORD dwError;
|
---|
| 126 | WCHAR wszAddress[RAS_ATADDRESSLEN + 1];
|
---|
| 127 | } RAS_PPP_ATCP_RESULT;
|
---|
| 128 |
|
---|
| 129 | typedef struct _RAS_PPP_PROJECTION_RESULT {
|
---|
| 130 | RAS_PPP_NBFCP_RESULT nbf;
|
---|
| 131 | RAS_PPP_IPCP_RESULT ip;
|
---|
| 132 | RAS_PPP_IPXCP_RESULT ipx;
|
---|
| 133 | RAS_PPP_ATCP_RESULT at;
|
---|
| 134 | } RAS_PPP_PROJECTION_RESULT;
|
---|
| 135 |
|
---|
| 136 | typedef struct _RAS_PORT_1 {
|
---|
| 137 | RAS_PORT_0 rasport0;
|
---|
| 138 | DWORD LineCondition;
|
---|
| 139 | DWORD HardwareCondition;
|
---|
| 140 | DWORD LineSpeed;
|
---|
| 141 | WORD NumStatistics;
|
---|
| 142 | WORD NumMediaParms;
|
---|
| 143 | DWORD SizeMediaParms;
|
---|
| 144 | RAS_PPP_PROJECTION_RESULT ProjResult;
|
---|
| 145 | } RAS_PORT_1,*PRAS_PORT_1;
|
---|
| 146 |
|
---|
| 147 | typedef struct _RAS_PORT_STATISTICS {
|
---|
| 148 | DWORD dwBytesXmited;
|
---|
| 149 | DWORD dwBytesRcved;
|
---|
| 150 | DWORD dwFramesXmited;
|
---|
| 151 | DWORD dwFramesRcved;
|
---|
| 152 | DWORD dwCrcErr;
|
---|
| 153 | DWORD dwTimeoutErr;
|
---|
| 154 | DWORD dwAlignmentErr;
|
---|
| 155 | DWORD dwHardwareOverrunErr;
|
---|
| 156 | DWORD dwFramingErr;
|
---|
| 157 | DWORD dwBufferOverrunErr;
|
---|
| 158 | DWORD dwBytesXmitedUncompressed;
|
---|
| 159 | DWORD dwBytesRcvedUncompressed;
|
---|
| 160 | DWORD dwBytesXmitedCompressed;
|
---|
| 161 | DWORD dwBytesRcvedCompressed;
|
---|
| 162 | DWORD dwPortBytesXmited;
|
---|
| 163 | DWORD dwPortBytesRcved;
|
---|
| 164 | DWORD dwPortFramesXmited;
|
---|
| 165 | DWORD dwPortFramesRcved;
|
---|
| 166 | DWORD dwPortCrcErr;
|
---|
| 167 | DWORD dwPortTimeoutErr;
|
---|
| 168 | DWORD dwPortAlignmentErr;
|
---|
| 169 | DWORD dwPortHardwareOverrunErr;
|
---|
| 170 | DWORD dwPortFramingErr;
|
---|
| 171 | DWORD dwPortBufferOverrunErr;
|
---|
| 172 | DWORD dwPortBytesXmitedUncompressed;
|
---|
| 173 | DWORD dwPortBytesRcvedUncompressed;
|
---|
| 174 | DWORD dwPortBytesXmitedCompressed;
|
---|
| 175 | DWORD dwPortBytesRcvedCompressed;
|
---|
| 176 | } RAS_PORT_STATISTICS,*PRAS_PORT_STATISTICS;
|
---|
| 177 |
|
---|
| 178 | #define RASDOWNLEVEL 10
|
---|
| 179 | #define RASADMIN_35 35
|
---|
| 180 | #define RASADMIN_CURRENT 40
|
---|
| 181 |
|
---|
| 182 | typedef struct _RAS_SERVER_0 {
|
---|
| 183 | WORD TotalPorts;
|
---|
| 184 | WORD PortsInUse;
|
---|
| 185 | DWORD RasVersion;
|
---|
| 186 | } RAS_SERVER_0,*PRAS_SERVER_0;
|
---|
| 187 |
|
---|
| 188 | DWORD WINAPI RasAdminServerGetInfo(const WCHAR *lpszServer,PRAS_SERVER_0 pRasServer0);
|
---|
| 189 | DWORD WINAPI RasAdminGetUserAccountServer(const WCHAR *lpszDomain,const WCHAR *lpszServer,LPWSTR lpszUserAccountServer);
|
---|
| 190 | DWORD WINAPI RasAdminUserGetInfo(const WCHAR *lpszUserAccountServer,const WCHAR *lpszUser,PRAS_USER_0 pRasUser0);
|
---|
| 191 | DWORD WINAPI RasAdminUserSetInfo(const WCHAR *lpszUserAccountServer,const WCHAR *lpszUser,const PRAS_USER_0 pRasUser0);
|
---|
| 192 | DWORD WINAPI RasAdminPortEnum(const WCHAR *lpszServer,PRAS_PORT_0 *ppRasPort0,WORD *pcEntriesRead);
|
---|
| 193 | DWORD WINAPI RasAdminPortGetInfo(const WCHAR *lpszServer,const WCHAR *lpszPort,RAS_PORT_1 *pRasPort1,RAS_PORT_STATISTICS *pRasStats,RAS_PARAMETERS **ppRasParams);
|
---|
| 194 | DWORD WINAPI RasAdminPortClearStatistics(const WCHAR *lpszServer,const WCHAR *lpszPort);
|
---|
| 195 | DWORD WINAPI RasAdminPortDisconnect(const WCHAR *lpszServer,const WCHAR *lpszPort);
|
---|
| 196 | DWORD WINAPI RasAdminFreeBuffer(PVOID Pointer);
|
---|
| 197 | WINBOOL WINAPI RasAdminAcceptNewConnection (RAS_PORT_1 *pRasPort1,RAS_PORT_STATISTICS *pRasStats,RAS_PARAMETERS *pRasParams);
|
---|
| 198 | VOID WINAPI RasAdminConnectionHangupNotification (RAS_PORT_1 *pRasPort1,RAS_PORT_STATISTICS *pRasStats,RAS_PARAMETERS *pRasParams);
|
---|
| 199 | DWORD WINAPI RasAdminGetIpAddressForUser (WCHAR *lpszUserName,WCHAR *lpszPortName,IPADDR *pipAddress,WINBOOL *bNotifyRelease);
|
---|
| 200 | VOID WINAPI RasAdminReleaseIpAddress (WCHAR *lpszUserName,WCHAR *lpszPortName,IPADDR *pipAddress);
|
---|
| 201 |
|
---|
| 202 | #endif
|
---|
| 203 |
|
---|
| 204 | #ifdef __cplusplus
|
---|
| 205 | }
|
---|
| 206 | #endif
|
---|
| 207 | #endif
|
---|