Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com --- include/ras.h | 336 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 288 insertions(+), 48 deletions(-)
diff --git a/include/ras.h b/include/ras.h index a8c04da2b6db..027b6d5b9c3b 100644 --- a/include/ras.h +++ b/include/ras.h @@ -1,5 +1,6 @@ /* * Copyright (C) 1998 Marcus Meissner + * Copyright (C) 2019 Vijay Kiran Kamuju * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,16 +29,29 @@ extern "C" { #include <inaddr.h> #include <in6addr.h>
+typedef enum RASAPIVERSION +{ + RASAPIVERSION_500 = 1, + RASAPIVERSION_501, + RASAPIVERSION_600, + RASAPIVERSION_601, +} RASAPIVERSION; + +#define RASAPIVERSION_CURRENT RASAPIVERSION_601 + #define RAS_MaxCallbackNumber RAS_MaxPhoneNumber #define RAS_MaxDeviceName 128 #define RAS_MaxDeviceType 16 #define RAS_MaxEntryName 256 #define RAS_MaxPhoneNumber 128 +#define RAS_MaxIpAddress 15 +#define RAS_MaxIpxAddress 21 #define RAS_MaxAreaCode 10 #define RAS_MaxPadType 32 #define RAS_MaxX25Address 200 #define RAS_MaxFacilities 200 #define RAS_MaxUserData 200 +#define RAS_MaxReplyMessage 1024 #define RAS_MaxDnsSuffix 256
/* szDeviceType strings for RASDEVINFO */ @@ -57,6 +71,13 @@ extern "C" { #define RASDT_Parallel "PARALLEL" #define RASDT_PPPoE "PPPoE"
+#define RASDIALEVENT "RasDialEvent" +#define WM_RASDIALEVENT 0xCCCD + +typedef VOID (WINAPI *RASDIALFUNC)(UINT, RASCONNSTATE, DWORD); +typedef VOID (WINAPI *RASDIALFUNC1)(HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD); +typedef DWORD (WINAPI *RASDIALFUNC2)(ULONG_PTR, DWORD, HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD); + typedef struct tagRASDEVINFOA { DWORD dwSize; CHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; @@ -75,6 +96,31 @@ DECL_WINELIB_TYPE_AW(LPRASDEVINFO) DECLARE_HANDLE(HRASCONN); typedef HRASCONN* LPHRASCONN;
+#define RASCF_AllUsers 0x00000001 +#define RASCF_GlobalCreds 0x00000002 +#define RASCF_OwnerKnown 0x00000004 +#define RASCF_OwnerMatch 0x00000008 + +#define RASCF_IsOwner(rascFlags) (((rascFlags) & (RASCF_OwnerKnown|RASCF_OwnerMatch)) == (RASCF_OwnerKnown|RASCF_OwnerMatch)) +#define RASCF_IsNotOwner(rascFlags) (((rascFlags) & (RASCF_OwnerKnown|RASCF_OwnerMatch)) == (RASCF_OwnerKnown)) + +#define RDEOPT_UsePrefixSuffix 0x00000001 +#define RDEOPT_PausedStates 0x00000002 +#define RDEOPT_IgnoreModemSpeaker 0x00000004 +#define RDEOPT_SetModemSpeaker 0x00000008 +#define RDEOPT_IgnoreSoftwareCompression 0x00000010 +#define RDEOPT_SetSoftwareCompression 0x00000020 +#define RDEOPT_DisableConnectedUI 0x00000040 +#define RDEOPT_DisableReconnectUI 0x00000080 +#define RDEOPT_DisableReconnect 0x00000100 +#define RDEOPT_NoUser 0x00000200 +#define RDEOPT_PauseOnScript 0x00000400 +#define RDEOPT_Router 0x00000800 +#define RDEOPT_CustomDial 0x00001000 +#define RDEOPT_UseCustomScripting 0x00002000 +#define RDEOPT_InvokeAutoTriggerCredentialUI 0x00004000 +#define RDEOPT_EapInfoCryptInCapable 0x00008000 + typedef struct tagRASCONNA { DWORD dwSize; HRASCONN hRasConn; @@ -106,14 +152,20 @@ typedef struct tagRASCONNW { DECL_WINELIB_TYPE_AW(RASCONN) DECL_WINELIB_TYPE_AW(LPRASCONN)
+#define REN_User 0x00000000 +#define REN_AllUsers 0x00000001 typedef struct tagRASENTRYNAMEA { DWORD dwSize; CHAR szEntryName[ RAS_MaxEntryName + 1 ]; + DWORD dwFlags; + CHAR szPhonebookPath[MAX_PATH + 1]; } RASENTRYNAMEA, *LPRASENTRYNAMEA;
typedef struct tagRASENTRYNAMEW { DWORD dwSize; WCHAR szEntryName[ RAS_MaxEntryName + 1 ]; + DWORD dwFlags; + WCHAR szPhonebookPath[MAX_PATH + 1]; } RASENTRYNAMEW, *LPRASENTRYNAMEW;
DECL_WINELIB_TYPE_AW(RASENTRYNAME) @@ -129,6 +181,8 @@ typedef struct tagRASDIALPARAMSA { CHAR szDomain[ DNLEN + 1 ]; DWORD dwSubEntry; DWORD dwCallbackId; + DWORD dwIfIndex; + LPSTR szEncPassword; } RASDIALPARAMSA, *LPRASDIALPARAMSA;
typedef struct tagRASDIALPARAMSW { @@ -141,31 +195,124 @@ typedef struct tagRASDIALPARAMSW { WCHAR szDomain[ DNLEN + 1 ]; DWORD dwSubEntry; DWORD dwCallbackId; + DWORD dwIfIndex; + LPWSTR szEncPassword; } RASDIALPARAMSW, *LPRASDIALPARAMSW;
DECL_WINELIB_TYPE_AW(RASDIALPARAMS) DECL_WINELIB_TYPE_AW(LPRASDIALPARAMS)
typedef struct tagRASIPADDR { - BYTE classA,classB,classC,classD; + 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 in_addr RASIPV4ADDR; + +typedef struct in6_addr RASIPV6ADDR; + +#define RASEO_UseCountryAndAreaCodes 0x00000001 +#define RASEO_SpecificIpAddr 0x00000002 +#define RASEO_SpecificNameServers 0x00000004 +#define RASEO_IpHeaderCompression 0x00000008 +#define RASEO_RemoteDefaultGateway 0x00000010 +#define RASEO_DisableLcpExtensions 0x00000020 +#define RASEO_TerminalBeforeDial 0x00000040 +#define RASEO_TerminalAfterDial 0x00000080 +#define RASEO_ModemLights 0x00000100 +#define RASEO_SwCompression 0x00000200 +#define RASEO_RequireEncryptedPw 0x00000400 +#define RASEO_RequireMsEncryptedPw 0x00000800 +#define RASEO_RequireDataEncryption 0x00001000 +#define RASEO_NetworkLogon 0x00002000 +#define RASEO_UseLogonCredentials 0x00004000 +#define RASEO_PromoteAlternates 0x00008000 +#define RASEO_SecureLocalFiles 0x00010000 +#define RASEO_RequireEAP 0x00020000 +#define RASEO_RequirePAP 0x00040000 +#define RASEO_RequireSPAP 0x00080000 +#define RASEO_Custom 0x00100000 +#define RASEO_PreviewPhoneNumber 0x00200000 +#define RASEO_SharedPhoneNumbers 0x00800000 +#define RASEO_PreviewUserPw 0x01000000 +#define RASEO_PreviewDomain 0x02000000 +#define RASEO_ShowDialingProgress 0x04000000 +#define RASEO_RequireCHAP 0x08000000 +#define RASEO_RequireMsCHAP 0x10000000 +#define RASEO_RequireMsCHAP2 0x20000000 +#define RASEO_RequireW95MSCHAP 0x40000000 +#define RASEO_CustomScript 0x80000000 + +#define RASNP_NetBEUI 0x00000001 +#define RASNP_Ipx 0x00000002 +#define RASNP_Ip 0x00000004 +#define RASNP_Ipv6 0x00000008 + +#define RASFP_Ppp 0x00000001 +#define RASFP_Slip 0x00000002 +#define RASFP_Ras 0x00000004 + +#define RASEDM_DialAll 1 +#define RASEDM_DialAsNeeded 2 + +#define RASIDS_Disabled 0xffffffff +#define RASIDS_UseGlobalValue 0 + +#define RASET_Phone 1 +#define RASET_Vpn 2 +#define RASET_Direct 3 +#define RASET_Internet 4 +#define RASET_Broadband 5 + +#define ET_None 0 +#define ET_Require 1 +#define ET_RequireMax 2 +#define ET_Optional 3 + +#define VS_Default 0 +#define VS_PptpOnly 1 +#define VS_PptpFirst 2 +#define VS_L2tpOnly 3 +#define VS_L2tpFirst 4 +#define VS_SstpOnly 5 +#define VS_SstpFirst 6 +#define VS_Ikev2Only 7 +#define VS_Ikev2First 8 +#define VS_GREOnly 9 +#define VS_PptpSstp 12 +#define VS_L2tpSstp 13 +#define VS_Ikev2Sstp 14 + +#define RASEO2_SecureFileAndPrint 0x00000001 +#define RASEO2_SecureClientForMSNet 0x00000002 +#define RASEO2_DontNegotiateMultilink 0x00000004 +#define RASEO2_DontUseRasCredentials 0x00000008 +#define RASEO2_UsePreSharedKey 0x00000010 +#define RASEO2_Internet 0x00000020 +#define RASEO2_DisableNbtOverIP 0x00000040 +#define RASEO2_UseGlobalDeviceSettings 0x00000080 +#define RASEO2_ReconnectIfDropped 0x00000100 +#define RASEO2_SharePhoneNumbers 0x00000200 +#define RASEO2_SecureRoutingCompartment 0x00000400 +#define RASEO2_UseTypicalSettings 0x00000800 +#define RASEO2_IPv6SpecificNameServers 0x00001000 +#define RASEO2_IPv6RemoteDefaultGateway 0x00002000 +#define RASEO2_RegisterIpWithDNS 0x00004000 +#define RASEO2_UseDNSSuffixForRegistration 0x00008000 +#define RASEO2_IPv4ExplicitMetric 0x00010000 +#define RASEO2_IPv6ExplicitMetric 0x00020000 +#define RASEO2_DisableIKENameEkuCheck 0x00040000 +#define RASEO2_DisableClassBasedStaticRoute 0x00080000 +#define RASEO2_SpecificIPv6Addr 0x00100000 +#define RASEO2_DisableMobility 0x00200000 +#define RASEO2_RequireMachineCertificates 0x00400000 +#define RASEO2_UsePreSharedKeyForIkev2Initiator 0x00800000 +#define RASEO2_UsePreSharedKeyForIkev2Responder 0x01000000 +#define RASEO2_CacheCredentials 0x02000000 +#define RASEO2_AutoTriggerCapable 0x04000000 +#define RASEO2_IsThirdPartyProfile 0x08000000 +#define RASEO2_AuthTypeIsOtp 0x10000000 +#define RASEO2_IsAlwaysOn 0x20000000 +#define RASEO2_IsPrivateNetwork 0x40000000 typedef struct tagRASENTRYA { DWORD dwSize; DWORD dwfOptions; @@ -238,6 +385,15 @@ typedef struct tagRASENTRYA { CHAR szPrerequisiteEntry[RAS_MaxEntryName + 1]; DWORD dwRedialCount; DWORD dwRedialPause; + + RASIPV6ADDR ipv6addrDns; + RASIPV6ADDR ipv6addrDnsAlt; + DWORD dwIPv4InterfaceMetric; + DWORD dwIPv6InterfaceMetric; + + RASIPV6ADDR ipv6addr; + DWORD dwIPv6PrefixLength; + DWORD dwNetworkOutageTime; } RASENTRYA, *LPRASENTRYA;
typedef struct tagRASENTRYW { @@ -312,45 +468,77 @@ typedef struct tagRASENTRYW { WCHAR szPrerequisiteEntry[RAS_MaxEntryName + 1]; DWORD dwRedialCount; DWORD dwRedialPause; + + RASIPV6ADDR ipv6addrDns; + RASIPV6ADDR ipv6addrDnsAlt; + DWORD dwIPv4InterfaceMetric; + DWORD dwIPv6InterfaceMetric; + + RASIPV6ADDR ipv6addr; + DWORD dwIPv6PrefixLength; + DWORD dwNetworkOutageTime; } RASENTRYW, *LPRASENTRYW;
DECL_WINELIB_TYPE_AW(RASENTRY)
+#define RASTUNNELENDPOINT_UNKNOWN 0 +#define RASTUNNELENDPOINT_IPv4 1 +#define RASTUNNELENDPOINT_IPv6 2 +typedef struct tagRASTUNNELENDPOINT +{ + DWORD dwType; + union { + RASIPV4ADDR ipv4; + RASIPV6ADDR ipv6; + } DUMMYUNIONNAME; +} RASTUNNELENDPOINT; + #define RASCS_PAUSED 0x1000 #define RASCS_DONE 0x2000 typedef enum tagRASCONNSTATE { - RASCS_OpenPort = 0, - RASCS_PortOpened, - RASCS_ConnectDevice, - RASCS_DeviceConnected, - RASCS_AllDevicesConnected, - RASCS_Authenticate, - RASCS_AuthNotify, - RASCS_AuthRetry, - RASCS_AuthCallback, - RASCS_AuthChangePassword, - RASCS_AuthProject, - RASCS_AuthLinkSpeed, - RASCS_AuthAck, - RASCS_ReAuthenticate, - RASCS_Authenticated, - RASCS_PrepareForCallback, - RASCS_WaitForModemReset, - RASCS_WaitForCallback, - RASCS_Projected, - RASCS_StartAuthentication, - RASCS_CallbackComplete, - RASCS_LogonNetwork, - RASCS_SubEntryConnected, - RASCS_SubEntryDisconnected, - RASCS_Interactive = RASCS_PAUSED, - RASCS_RetryAuthentication, - RASCS_CallbackSetByCaller, - RASCS_PasswordExpired, - RASCS_Connected = RASCS_DONE, - RASCS_Disconnected -} RASCONNSTATE, *LPRASCONNSTATE; + RASCS_OpenPort = 0, + RASCS_PortOpened, + RASCS_ConnectDevice, + RASCS_DeviceConnected, + RASCS_AllDevicesConnected, + RASCS_Authenticate, + RASCS_AuthNotify, + RASCS_AuthRetry, + RASCS_AuthCallback, + RASCS_AuthChangePassword, + RASCS_AuthProject, + RASCS_AuthLinkSpeed, + RASCS_AuthAck, + RASCS_ReAuthenticate, + RASCS_Authenticated, + RASCS_PrepareForCallback, + RASCS_WaitForModemReset, + RASCS_WaitForCallback, + RASCS_Projected, + RASCS_StartAuthentication, + RASCS_CallbackComplete, + RASCS_LogonNetwork, + RASCS_SubEntryConnected, + RASCS_SubEntryDisconnected, + RASCS_ApplySettings, + RASCS_Interactive = RASCS_PAUSED, + RASCS_RetryAuthentication, + RASCS_CallbackSetByCaller, + RASCS_PasswordExpired, + RASCS_InvokeEapUI, + RASCS_Connected = RASCS_DONE, + RASCS_Disconnected +} RASCONNSTATE, *LPRASCONNSTATE; + +#define RASCSS_DONE 0x2000 +typedef enum tagRASCONNSUBSTATE +{ + RASCSS_None = 0, + RASCSS_Dormant, + RASCSS_Reconnecting, + RASCSS_Reconnected = RASCSS_DONE, +} RASCONNSUBSTATE, *LPRASCONNSUBSTATE;
typedef struct tagRASCONNSTATUSA { @@ -359,6 +547,10 @@ typedef struct tagRASCONNSTATUSA DWORD dwError; CHAR szDeviceType[RAS_MaxDeviceType + 1]; CHAR szDeviceName[RAS_MaxDeviceName + 1]; + CHAR szPhoneNumber[RAS_MaxPhoneNumber + 1]; + RASTUNNELENDPOINT localEndPoint; + RASTUNNELENDPOINT remoteEndPoint; + RASCONNSUBSTATE rasconnsubstate; } RASCONNSTATUSA, *LPRASCONNSTATUSA;
typedef struct tagRASCONNSTATUSW @@ -368,6 +560,10 @@ typedef struct tagRASCONNSTATUSW DWORD dwError; WCHAR szDeviceType[RAS_MaxDeviceType + 1]; WCHAR szDeviceName[RAS_MaxDeviceName + 1]; + WCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1]; + RASTUNNELENDPOINT localEndPoint; + RASTUNNELENDPOINT remoteEndPoint; + RASCONNSUBSTATE rasconnsubstate; } RASCONNSTATUSW, *LPRASCONNSTATUSW;
DECL_WINELIB_TYPE_AW(RASCONNSTATUS) @@ -378,7 +574,9 @@ typedef enum tagRASPROJECTION RASP_PppNbf = 0x803F, RASP_PppIpx = 0x802B, RASP_PppIp = 0x8021, + RASP_PppCcp = 0x80FD, RASP_PppLcp = 0xC021, + RASP_PppIpv6 = 0x8057, RASP_Slip = 0x20000 } RASPROJECTION, *LPRASPROJECTION;
@@ -402,12 +600,28 @@ typedef struct tagRASSUBENTRYW DWORD dwAlternateOffset; } RASSUBENTRYW, *LPRASSUBENTRYW;
+typedef struct tagRASEAPINFO +{ + DWORD dwSizeofEapInfo; + BYTE *pbEapInfo; +} RASEAPINFO; + +typedef struct tagRASDEVSPECIFICINFO +{ + DWORD dwSize; + BYTE *pbDevSpecificInfo; +} RASDEVSPECIFICINFO, *PRASDEVSPECIFICINFO; + typedef struct tagRASDIALEXTENSIONS { DWORD dwSize; DWORD dwfOptions; HWND hwndParent; ULONG_PTR reserved; + ULONG_PTR reserved1; + RASEAPINFO RasEapInfo; + BOOL fSkipPppAuth; + RASDEVSPECIFICINFO RasDevSpecificInfo; } RASDIALEXTENSIONS, *LPRASDIALEXTENSIONS;
typedef struct tagRASAUTODIALENTRYA @@ -426,6 +640,32 @@ typedef struct tagRASAUTODIALENTRYW WCHAR szEntry[ RAS_MaxEntryName + 1 ]; } RASAUTODIALENTRYW, *LPRASAUTODIALENTRYW;
+#define RASADFLG_PositionDlg 0x00000001 +typedef struct tagRASADPARAMS +{ + DWORD dwSize; + HWND hwndOwner; + DWORD dwFlags; + LONG xDlg; + LONG yDlg; +} RASADPARAMS, *LPRASADPARAMS; + +typedef BOOL (WINAPI *RASADFUNCA)(LPSTR, LPSTR, LPRASADPARAMS, LPDWORD); +typedef BOOL (WINAPI *RASADFUNCW)(LPWSTR, LPWSTR, LPRASADPARAMS, LPDWORD); + +#define RASADP_DisableConnectionQuery 0 +#define RASADP_LoginSessionDisable 1 +#define RASADP_SavedAddressesLimit 2 +#define RASADP_FailedConnectionTimeout 3 +#define RASADP_ConnectionQueryTimeout 4 + +#define RASCN_Connection 0x00000001 +#define RASCN_Disconnection 0x00000002 +#define RASCN_BandwidthAdded 0x00000004 +#define RASCN_BandwidthRemoved 0x00000008 +#define RASCN_Dormant 0x00000010 +#define RASCN_ReConnection 0x00000020 + typedef struct _RAS_STATS { DWORD dwSize;