ras.h 10.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright (C) 1998 Marcus Meissner
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

19 20 21
#ifndef __WINE_RAS_H
#define __WINE_RAS_H

22
#include <lmcons.h>
23

24 25 26
#ifdef __cplusplus
extern "C" {
#endif
27
#include <pshpack4.h>
28

29
#define RAS_MaxCallbackNumber RAS_MaxPhoneNumber
30 31 32 33
#define RAS_MaxDeviceName     128
#define RAS_MaxDeviceType     16
#define RAS_MaxEntryName      256
#define RAS_MaxPhoneNumber    128
34 35 36 37 38
#define RAS_MaxAreaCode       10
#define RAS_MaxPadType        32
#define RAS_MaxX25Address     200
#define RAS_MaxFacilities     200
#define RAS_MaxUserData       200
39
#define RAS_MaxDnsSuffix      256
40 41

DECLARE_HANDLE(HRASCONN);
42

43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
/* szDeviceType strings for RASDEVINFO */
#define	RASDT_Direct	"direct"
#define	RASDT_Modem	"modem"
#define	RASDT_Isdn	"isdn"
#define	RASDT_X25	"x25"

#define RASBASE				600
#define ERROR_BUFFER_TOO_SMALL		(RASBASE+3)
#define ERROR_INVALID_SIZE		(RASBASE+32)

typedef struct tagRASDEVINFOA {
    DWORD    dwSize;
    CHAR     szDeviceType[ RAS_MaxDeviceType + 1 ];
    CHAR     szDeviceName[ RAS_MaxDeviceName + 1 ];
} RASDEVINFOA, *LPRASDEVINFOA;

typedef struct tagRASDEVINFOW {
    DWORD    dwSize;
    WCHAR    szDeviceType[ RAS_MaxDeviceType + 1 ];
    WCHAR    szDeviceName[ RAS_MaxDeviceName + 1 ];
} RASDEVINFOW, *LPRASDEVINFOW;

DECL_WINELIB_TYPE_AW(RASDEVINFO)
DECL_WINELIB_TYPE_AW(LPRASDEVINFO)

68
typedef struct tagRASCONNA {
69 70 71 72 73 74 75
    DWORD    dwSize;
    HRASCONN hRasConn;
    CHAR     szEntryName[ RAS_MaxEntryName + 1 ];
    CHAR     szDeviceType[ RAS_MaxDeviceType + 1 ];
    CHAR     szDeviceName[ RAS_MaxDeviceName + 1 ];
    CHAR     szPhonebook[ MAX_PATH ];
    DWORD    dwSubEntry;
76
} RASCONNA,*LPRASCONNA;
77

78 79 80 81 82 83 84 85 86 87 88 89 90 91
typedef struct tagRASCONNW {
    DWORD    dwSize;
    HRASCONN hRasConn;
    WCHAR    szEntryName[ RAS_MaxEntryName + 1 ];
    WCHAR    szDeviceType[ RAS_MaxDeviceType + 1 ];
    WCHAR    szDeviceName[ RAS_MaxDeviceName + 1 ];
    WCHAR    szPhonebook[ MAX_PATH ];
    DWORD    dwSubEntry;
} RASCONNW,*LPRASCONNW;

DECL_WINELIB_TYPE_AW(RASCONN)
DECL_WINELIB_TYPE_AW(LPRASCONN)

typedef struct tagRASENTRYNAMEA {
92 93
    DWORD dwSize;
    CHAR  szEntryName[ RAS_MaxEntryName + 1 ];
94
} RASENTRYNAMEA, *LPRASENTRYNAMEA;
95

96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
typedef struct tagRASENTRYNAMEW {
    DWORD dwSize;
    WCHAR szEntryName[ RAS_MaxEntryName + 1 ];
} RASENTRYNAMEW, *LPRASENTRYNAMEW;

DECL_WINELIB_TYPE_AW(RASENTRYNAME)
DECL_WINELIB_TYPE_AW(LPRASENTRYNAME)

typedef struct tagRASDIALPARAMSA {
    DWORD dwSize;
    CHAR szEntryName[ RAS_MaxEntryName + 1 ];
    CHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
    CHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
    CHAR szUserName[ UNLEN + 1 ];
    CHAR szPassword[ PWLEN + 1 ];
    CHAR szDomain[ DNLEN + 1 ];
    DWORD dwSubEntry;
    DWORD dwCallbackId;
} RASDIALPARAMSA, *LPRASDIALPARAMSA;

typedef struct tagRASDIALPARAMSW {
117 118 119 120 121 122 123 124 125
    DWORD dwSize;
    WCHAR szEntryName[ RAS_MaxEntryName + 1 ];
    WCHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
    WCHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
    WCHAR szUserName[ UNLEN + 1 ];
    WCHAR szPassword[ PWLEN + 1 ];
    WCHAR szDomain[ DNLEN + 1 ];
    DWORD dwSubEntry;
    DWORD dwCallbackId;
126 127 128 129
} RASDIALPARAMSW, *LPRASDIALPARAMSW;

DECL_WINELIB_TYPE_AW(RASDIALPARAMS)
DECL_WINELIB_TYPE_AW(LPRASDIALPARAMS)
130

131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
typedef struct tagRASIPADDR {
	BYTE classA,classB,classC,classD;
} RASIPADDR;

#define RASEO_UseCountryAndAreaCodes	0x0001
#define RASEO_SpecificIpAddr		0x0002
#define RASEO_SpecificNameServers	0x0004
#define RASEO_IpHeaderCompression	0x0008
#define RASEO_RemoteDefaultGateway	0x0010
#define RASEO_DisableLcpExtensions	0x0020
#define RASEO_TerminalBeforeDial	0x0040
#define RASEO_TerminalAfterDial		0x0080
#define RASEO_ModemLights		0x0100
#define RASEO_SwCompression		0x0200
#define RASEO_RequireEncryptedPw	0x0400
#define RASEO_RequireMsEncryptedPw	0x0800
#define RASEO_RequireDataEncryption	0x1000
#define RASEO_NetworkLogon		0x2000
#define RASEO_UseLogonCredentials	0x4000
#define RASEO_PromoteAlternates		0x8000
typedef struct tagRASENTRYA {
    DWORD dwSize;
    DWORD dwfOptions;

    /* Location */

    DWORD dwCountryID;
    DWORD dwCountryCode;
    CHAR szAreaCode[ RAS_MaxAreaCode + 1 ];
    CHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
    DWORD dwAlternateOffset;

    /* IP related stuff */

    RASIPADDR ipaddr;
    RASIPADDR ipaddrDns;
    RASIPADDR ipaddrDnsAlt;
    RASIPADDR ipaddrWins;
    RASIPADDR ipaddrWinsAlt;

    /* Framing (for ppp/isdn etc...) */

    DWORD dwFrameSize;
    DWORD dwfNetProtocols;
    DWORD dwFramingProtocol;

    CHAR szScript[ MAX_PATH ];

    CHAR szAutodialDll[ MAX_PATH ];
    CHAR szAutodialFunc[ MAX_PATH ];

    CHAR szDeviceType[ RAS_MaxDeviceType + 1 ];
    CHAR szDeviceName[ RAS_MaxDeviceName + 1 ];

    /* x25 only */

    CHAR szX25PadType[ RAS_MaxPadType + 1 ];
    CHAR szX25Address[ RAS_MaxX25Address + 1 ];
    CHAR szX25Facilities[ RAS_MaxFacilities + 1 ];
    CHAR szX25UserData[ RAS_MaxUserData + 1 ];
    DWORD dwChannels;

    DWORD dwReserved1;
    DWORD dwReserved2;

    /* Multilink and BAP */

    DWORD dwSubEntries;
    DWORD dwDialMode;
    DWORD dwDialExtraPercent;
    DWORD dwDialExtraSampleSeconds;
    DWORD dwHangUpExtraPercent;
    DWORD dwHangUpExtraSampleSeconds;

    /* Idle time out */
    DWORD dwIdleDisconnectSeconds;

    DWORD dwType;		/* entry type */
    DWORD dwEncryptionType;	/* type of encryption to use */
    DWORD dwCustomAuthKey;	/* authentication key for EAP */
    GUID guidId;		/* guid that represents the phone-book entry  */
    CHAR szCustomDialDll[MAX_PATH];    /* DLL for custom dialing  */
    DWORD dwVpnStrategy;         /* specifies type of VPN protocol */
214

215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
    DWORD dwfOptions2;
    DWORD dwfOptions3;
    CHAR szDnsSuffix[RAS_MaxDnsSuffix];
    DWORD dwTcpWindowSize;
    CHAR szPrerequisitePbk[MAX_PATH];
    CHAR szPrerequisiteEntry[RAS_MaxEntryName + 1];
    DWORD dwRedialCount;
    DWORD dwRedialPause;
} RASENTRYA, *LPRASENTRYA;

typedef struct tagRASENTRYW {
    DWORD dwSize;
    DWORD dwfOptions;

    /* Location */

    DWORD dwCountryID;
    DWORD dwCountryCode;
    WCHAR szAreaCode[ RAS_MaxAreaCode + 1 ];
    WCHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
    DWORD dwAlternateOffset;

    /* IP related stuff */

    RASIPADDR ipaddr;
    RASIPADDR ipaddrDns;
    RASIPADDR ipaddrDnsAlt;
    RASIPADDR ipaddrWins;
    RASIPADDR ipaddrWinsAlt;

    /* Framing (for ppp/isdn etc...) */

    DWORD dwFrameSize;
    DWORD dwfNetProtocols;
    DWORD dwFramingProtocol;

    WCHAR szScript[ MAX_PATH ];

    WCHAR szAutodialDll[ MAX_PATH ];
    WCHAR szAutodialFunc[ MAX_PATH ];

    WCHAR szDeviceType[ RAS_MaxDeviceType + 1 ];
    WCHAR szDeviceName[ RAS_MaxDeviceName + 1 ];

    /* x25 only */

    WCHAR szX25PadType[ RAS_MaxPadType + 1 ];
    WCHAR szX25Address[ RAS_MaxX25Address + 1 ];
    WCHAR szX25Facilities[ RAS_MaxFacilities + 1 ];
    WCHAR szX25UserData[ RAS_MaxUserData + 1 ];
    DWORD dwChannels;

    DWORD dwReserved1;
    DWORD dwReserved2;

    /* Multilink and BAP */

    DWORD dwSubEntries;
    DWORD dwDialMode;
    DWORD dwDialExtraPercent;
    DWORD dwDialExtraSampleSeconds;
    DWORD dwHangUpExtraPercent;
    DWORD dwHangUpExtraSampleSeconds;

    /* Idle time out */
    DWORD dwIdleDisconnectSeconds;

    DWORD dwType;		/* entry type */
    DWORD dwEncryptionType;	/* type of encryption to use */
    DWORD dwCustomAuthKey;	/* authentication key for EAP */
    GUID guidId;		/* guid that represents the phone-book entry  */
    WCHAR szCustomDialDll[MAX_PATH];    /* DLL for custom dialing  */
    DWORD dwVpnStrategy;         /* specifies type of VPN protocol */
288

289 290 291 292 293 294 295 296 297 298 299 300
    DWORD dwfOptions2;
    DWORD dwfOptions3;
    WCHAR szDnsSuffix[RAS_MaxDnsSuffix];
    DWORD dwTcpWindowSize;
    WCHAR szPrerequisitePbk[MAX_PATH];
    WCHAR szPrerequisiteEntry[RAS_MaxEntryName + 1];
    DWORD dwRedialCount;
    DWORD dwRedialPause;
} RASENTRYW, *LPRASENTRYW;

DECL_WINELIB_TYPE_AW(RASENTRY)

301 302 303 304 305 306
DWORD WINAPI RasDeleteEntryA(LPCSTR,LPCSTR);
DWORD WINAPI RasDeleteEntryW(LPCWSTR,LPCWSTR);
#define      RasDeleteEntry WINELIB_NAME_AW(RasDeleteEntry)
DWORD WINAPI RasDeleteSubEntryA(LPCSTR,LPCSTR,DWORD);
DWORD WINAPI RasDeleteSubEntryW(LPCWSTR,LPCWSTR,DWORD);
#define      RasDeleteSubEntry WINELIB_NAME_AW(RasDeleteSubEntry)
307 308 309
DWORD WINAPI RasEnumConnectionsA(LPRASCONNA,LPDWORD,LPDWORD);
DWORD WINAPI RasEnumConnectionsW(LPRASCONNW,LPDWORD,LPDWORD);
#define      RasEnumConnections WINELIB_NAME_AW(RasEnumConnections)
310 311 312
DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA,LPDWORD,LPDWORD);
DWORD WINAPI RasEnumDevicesW(LPRASDEVINFOW,LPDWORD,LPDWORD);
#define      RasEnumDevices WINELIB_NAME_AW(RasEnumDevices)
313 314
DWORD WINAPI RasEnumEntriesA(LPCSTR,LPCSTR,LPRASENTRYNAMEA,LPDWORD,LPDWORD);
DWORD WINAPI RasEnumEntriesW(LPCWSTR,LPCWSTR,LPRASENTRYNAMEW,LPDWORD,LPDWORD);
315
#define      RasEnumEntries WINELIB_NAME_AW(RasEnumEntries)
316 317
DWORD WINAPI RasGetEntryDialParamsA(LPCSTR,LPRASDIALPARAMSA,LPBOOL);
DWORD WINAPI RasGetEntryDialParamsW(LPCWSTR,LPRASDIALPARAMSW,LPBOOL);
318 319 320 321
#define      RasGetEntryDialParams WINELIB_NAME_AW(RasGetEntryDialParams)
DWORD WINAPI RasHangUpA(HRASCONN);
DWORD WINAPI RasHangUpW(HRASCONN);
#define      RasHangUp WINELIB_NAME_AW(RasHangUp)
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
DWORD WINAPI RasValidateEntryNameA(LPCSTR  lpszPhonebook, LPCSTR  lpszEntry);
DWORD WINAPI RasValidateEntryNameW(LPCWSTR lpszPhonebook, LPCWSTR lpszEntry);
#define RasValidateEntryName WINELIB_NAME_AW(RasValidateEntryName)
DWORD WINAPI RasSetEntryPropertiesA(LPCSTR lpszPhonebook, LPCSTR lpszEntry,
        LPRASENTRYA lpRasEntry, DWORD dwEntryInfoSize, LPBYTE lpbDeviceInfo,
	DWORD dwDeviceInfoSize);
DWORD WINAPI RasSetEntryPropertiesW(LPCWSTR lpszPhonebook, LPCWSTR lpszEntry,
        LPRASENTRYW lpRasEntry, DWORD dwEntryInfoSize, LPBYTE lpbDeviceInfo,
	DWORD dwDeviceInfoSize);
#define RasSetEntryProperties WINELIB_NAME_AW(RasSetEntryProperties)
DWORD WINAPI RasGetAutodialParamA(DWORD dwKey, LPVOID lpvValue, LPDWORD lpdwcbValue);
DWORD WINAPI RasGetAutodialParamW(DWORD dwKey, LPVOID lpvValue, LPDWORD lpdwcbValue);
#define RasGetAutodialParam WINELIB_NAME_AW(RasGetAutodialParam)
DWORD WINAPI RasSetAutodialEnableA(DWORD dwDialingLocation, BOOL fEnabled);
DWORD WINAPI RasSetAutodialEnableW(DWORD dwDialingLocation, BOOL fEnabled);
#define RasSetAutodialEnable WINELIB_NAME_AW(RasSetAutodialEnable)
338

339
#include <poppack.h>
340 341 342
#ifdef __cplusplus
}
#endif
343

344
#endif