Documentation ¶
Overview ¶
rasApi.go
Index ¶
- Constants
- func RasDialW(server, connName, name, pass string) (r1, r2 uintptr, lastErr error, hconn uint32)
- func RasDialW2(bookpath, server, connName, name, pass string) (r1, r2 uintptr, lastErr error, hconn uint32)
- func RasGetConnectStatusW(hconn uint32) int
- func RasGetEntryPropertiesW(connName string, r uintptr, dwBufferSize *uint32) (r1, r2 uintptr, lastErr error)
- func RasHangUpW(hconn uint32) bool
- func RasSetEntryPropertiesW(connName string) (r1, r2 uintptr, lastErr error)
- func RasSetVPN(connName string) (r1, r2 uintptr, lastErr error)
- func RasSetVPN2(connName, bookpath string) (r1, r2 uintptr, lastErr error)
- type GUID
- type RASCONNSTATUSW
- type RASDIALPARAMSW
- type RASENTRY
- type RASIPADDR
- type RASIPV6ADDR
Constants ¶
View Source
const ( RAS_MaxAreaCode = 10 //ok RAS_MaxPhoneNumber = 128 //ok MAX_PATH = 260 //ok RAS_MaxDeviceType = 16 //ok RAS_MaxDeviceName = 128 //ok RAS_MaxPadType = 32 //ok RAS_MaxX25Address = 200 //ok RAS_MaxFacilities = 200 //ok RAS_MaxUserData = 200 //ok RAS_MaxDnsSuffix = 256 //ok RAS_MaxEntryName = 256 //ok RASEO_UseCountryAndAreaCodes = 0x00000001 RASEO_SpecificIpAddr = 0x00000002 RASEO_SpecificNameServers = 0x00000004 RASEO_IpHeaderCompression = 0x00000008 RASEO_RemoteDefaultGateway = 0x00000010 RASEO_DisableLcpExtensions = 0x00000020 RASEO_TerminalBeforeDial = 0x00000040 RASEO_TerminalAfterDial = 0x00000080 RASEO_ModemLights = 0x00000100 RASEO_SwCompression = 0x00000200 RASEO_RequireEncryptedPw = 0x00000400 RASEO_RequireMsEncryptedPw = 0x00000800 RASEO_RequireDataEncryption = 0x00001000 RASEO_NetworkLogon = 0x00002000 RASEO_UseLogonCredentials = 0x00004000 RASEO_PromoteAlternates = 0x00008000 RASEO_SecureLocalFiles = 0x00010000 RASEO_RequireEAP = 0x00020000 RASEO_RequirePAP = 0x00040000 RASEO_RequireSPAP = 0x00080000 RASEO_Custom = 0x00100000 RASEO_PreviewPhoneNumber = 0x00200000 RASEO_PreviewUserPw = 0x01000000 RASEO_PreviewDomain = 0x02000000 RASEO_ShowDialingProgress = 0x04000000 RASEO_RequireCHAP = 0x08000000 RASEO_RequireMsCHAP = 0x10000000 RASEO_RequireMsCHAP2 = 0x20000000 RASEO_RequireW95MSCHAP = 0x40000000 RASEO_CustomScript = 0x80000000 RASNP_Ip = 0x00000004 RASFP_Ppp = 0x00000001 RASDT_PPPoE = "PPPoE" )
Variables ¶
This section is empty.
Functions ¶
func RasDialW2 ¶
func RasDialW2(bookpath, server, connName, name, pass string) (r1, r2 uintptr, lastErr error, hconn uint32)
连接到VPN,指定电话薄路径
func RasGetEntryPropertiesW ¶
func RasGetEntryPropertiesW(connName string, r uintptr, dwBufferSize *uint32) (r1, r2 uintptr, lastErr error)
取连接的信息
func RasSetEntryPropertiesW ¶
建立宽带连接
func RasSetVPN2 ¶
建立VPN连接,指定电话薄路径
Types ¶
type RASCONNSTATUSW ¶
type RASDIALPARAMSW ¶
type RASENTRY ¶
type RASENTRY struct { DwSize uint32 //DWORD dwSize; DwfOptions uint32 //DWORD dwfOptions; DwCountryID uint32 //DWORD dwCountryID; DwCountryCode uint32 //DWORD dwCountryCode; SzAreaCode [RAS_MaxAreaCode + 1]uint16 //TCHAR szAreaCode[RAS_MaxAreaCode + 1]; SzLocalPhoneNumber [RAS_MaxPhoneNumber + 1]uint16 //TCHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1]; DwAlternateOffset uint32 // DWORD dwAlternateOffset; Ipaddr RASIPADDR //RASIPADDR ipaddr IpaddrDns RASIPADDR //RASIPADDR ipaddrDns IpaddrDnsAlt RASIPADDR //RASIPADDR ipaddrDnsAlt IpaddrWins RASIPADDR // RASIPADDR ipaddrWins IpaddrWinsAlt RASIPADDR //RASIPADDR ipaddrWinsAlt DwFrameSize uint32 //DWORD dwFrameSize; DwfNetProtocols uint32 // DWORD dwfNetProtocols; DwFramingProtocol uint32 // DWORD dwFramingProtocol; SzScript [MAX_PATH]uint16 //TCHAR szScript[MAX_PATH]; SzAutodialDll [MAX_PATH]uint16 // TCHAR szAutodialDll[MAX_PATH]; SzAutodialFunc [MAX_PATH]uint16 // TCHAR szAutodialFunc[MAX_PATH]; SzDeviceType [RAS_MaxDeviceType + 1]uint16 // TCHAR szDeviceType[RAS_MaxDeviceType + 1]; SzDeviceName [RAS_MaxDeviceName + 1]uint16 // TCHAR szDeviceName[RAS_MaxDeviceName + 1]; SzX25PadType [RAS_MaxPadType + 1]uint16 // TCHAR szX25PadType[RAS_MaxPadType + 1]; SzX25Address [RAS_MaxX25Address + 1]uint16 // TCHAR szX25Address[RAS_MaxX25Address + 1]; SzX25Facilities [RAS_MaxFacilities + 1]uint16 // TCHAR szX25Facilities[RAS_MaxFacilities + 1]; SzX25UserData [RAS_MaxUserData + 1]uint16 //TCHAR szX25UserData[RAS_MaxUserData + 1]; DwChannels uint32 //DWORD dwChannels; DwReserved1 uint32 //DWORD dwReserved1; DwReserved2 uint32 // DWORD dwReserved2; DwSubEntries uint32 // DWORD dwSubEntries; DwDialMode uint32 // DWORD dwDialMode; DwDialExtraPercent uint32 // DWORD dwDialExtraPercent; DwDialExtraSampleSeconds uint32 // DWORD dwDialExtraSampleSeconds; DwHangUpExtraPercent uint32 // DWORD dwHangUpExtraPercent; DwHangUpExtraSampleSeconds uint32 // DWORD dwHangUpExtraSampleSeconds; DwIdleDisconnectSeconds uint32 // DWORD dwIdleDisconnectSeconds; DwType uint32 // DWORD dwType; DwEncryptionType uint32 // DWORD dwEncryptionType; DwCustomAuthKey uint32 // DWORD dwCustomAuthKey; GuidId GUID //GUID guidId SzCustomDialDll [MAX_PATH]uint16 // TCHAR szCustomDialDll[MAX_PATH]; DwVpnStrategy uint32 // DWORD dwVpnStrategy; DwfOptions2 uint32 // DWORD dwfOptions2; DwfOptions3 uint32 // DWORD dwfOptions3; SzDnsSuffix [RAS_MaxDnsSuffix]uint16 // TCHAR szDnsSuffix[RAS_MaxDnsSuffix]; DwTcpWindowSize uint32 // DWORD dwTcpWindowSize; SzPrerequisitePbk [MAX_PATH]uint16 // TCHAR szPrerequisitePbk[MAX_PATH]; SzPrerequisiteEntry [RAS_MaxEntryName + 1]uint16 // TCHAR szPrerequisiteEntry[RAS_MaxEntryName + 1]; DwRedialCount uint32 // DWORD dwRedialCount; DwRedialPause uint32 // DWORD dwRedialPause; Ipv6addrDns RASIPV6ADDR //RASIPV6ADDR ipv6addrDns Ipv6addrDnsAlt RASIPV6ADDR //RASIPV6ADDR ipv6addrDnsAlt DwIPv4InterfaceMetric uint32 // DWORD dwIPv4InterfaceMetric; DwIPv6InterfaceMetric uint32 // DWORD dwIPv6InterfaceMetric; Ipv6addr RASIPV6ADDR //RASIPV6ADDR ipv6addr DwIPv6PrefixLength uint32 // DWORD dwIPv6PrefixLength; DwNetworkOutageTime uint32 // DWORD dwNetworkOutageTime; }
type RASIPV6ADDR ¶
Click to show internal directories.
Click to hide internal directories.