Top Description Inners Fields Constructors Methods
com.sun.jna.platform.win32

public abstract Class Rasapi32Util

extends Object
Class Inheritance
Annotations
@SuppressWarnings:unchecked
Imports
java.util.HashMap, .Map, com.sun.jna.platform.win32.WinDef.BOOLByReference, .WinNT.HANDLE, .WinNT.HANDLEByReference, .WinRas.RASCONN, .WinRas.RASCREDENTIALS, .WinRas.RASDIALPARAMS, .WinRas.RASENTRY, .WinRas.RASPPPIP, .WinRas.RasDialFunc2, com.sun.jna.ptr.IntByReference

Rasapi32 utility API.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final Map<K, V>
private static Object
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static WinNT.HANDLE

Returns:

result reference
dialEntry
(String
The phone book entry name
entryName
)

Dial a phone book entry by name (Synchronously)

public static WinNT.HANDLE

Returns:

the HRASCONN for this connection
dialEntry
(String
The phone book entry name
entryName
,
WinRas.RasDialFunc2 func2)

Dial a phone book entry by name (Asynchronously - callback type 2)

public static WinRas.RASPPPIP

Returns:

the IP projection
getIPProjection
(WinNT.HANDLE
the RAS connection handle
hrasConn
)

Get the connection's IP projection

public static WinRas.RASDIALPARAMS

Returns:

the entry's dialing parameters parameters
getPhoneBookDialingParams
(String
the phone book entry name
entryName
)

get a phone book entry's dialing parameters

public static WinRas.RASENTRY.ByReference

Returns:

the RAS entry
getPhoneBookEntry
(String
the entry name
entryName
)

Return the phone book entry.

public static WinNT.HANDLE

Returns:

the RAS connection structure
getRasConnection
(String
the connection name
connName
)

Return a RAS connection by name

public static String

Returns:

the descriptive text
getRasConnectionStatusText
(int
the connection status
connStatus
)

Translate the connection status value to text

public static String

Returns:

the RAS description
getRasErrorString
(int
the error code
code
)

Get the RAS error description

public static void
hangupRasConnection(String
the connection name
connName
)

Hangup a connection by name

public static void
hangupRasConnection(WinNT.HANDLE
the connection
hrasConn
)

Hangup a connection

public static void
setPhoneBookEntry(String
the phone book entry name
entryName
,
WinRas.RASENTRY.ByReference
the entry parameters
rasEntry
)

Set a phone book entry

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONNECTION_STATE_TEXTback to summary
public static final Map<K, V> CONNECTION_STATE_TEXT
Annotations
@SuppressWarnings:rawtypes
phoneBookMutexback to summary
private static Object phoneBookMutex
RASP_PppIpback to summary
private static final int RASP_PppIp

Constructor Detail

Rasapi32Utilback to summary
public Rasapi32Util()

Method Detail

dialEntryback to summary
public static WinNT.HANDLE dialEntry(String entryName) throws Ras32Exception

Dial a phone book entry by name (Synchronously)

Parameters
entryName:String

The phone book entry name

Returns:WinNT.HANDLE

result reference

Exceptions
Ras32Exception:
errors
dialEntryback to summary
public static WinNT.HANDLE dialEntry(String entryName, WinRas.RasDialFunc2 func2) throws Ras32Exception

Dial a phone book entry by name (Asynchronously - callback type 2)

Parameters
entryName:String

The phone book entry name

Returns:WinNT.HANDLE

the HRASCONN for this connection

Exceptions
Ras32Exception:
errors
getIPProjectionback to summary
public static WinRas.RASPPPIP getIPProjection(WinNT.HANDLE hrasConn) throws Ras32Exception

Get the connection's IP projection

Parameters
hrasConn:WinNT.HANDLE

the RAS connection handle

Returns:WinRas.RASPPPIP

the IP projection

Exceptions
Ras32Exception:
errors
getPhoneBookDialingParamsback to summary
public static WinRas.RASDIALPARAMS getPhoneBookDialingParams(String entryName) throws Ras32Exception

get a phone book entry's dialing parameters

Parameters
entryName:String

the phone book entry name

Returns:WinRas.RASDIALPARAMS

the entry's dialing parameters parameters

Exceptions
Ras32Exception:
errors
getPhoneBookEntryback to summary
public static WinRas.RASENTRY.ByReference getPhoneBookEntry(String entryName) throws Ras32Exception

Return the phone book entry.

Parameters
entryName:String

the entry name

Returns:WinRas.RASENTRY.ByReference

the RAS entry

Exceptions
Ras32Exception:
any errors
getRasConnectionback to summary
public static WinNT.HANDLE getRasConnection(String connName) throws Ras32Exception

Return a RAS connection by name

Parameters
connName:String

the connection name

Returns:WinNT.HANDLE

the RAS connection structure

Exceptions
Ras32Exception:
errors
getRasConnectionStatusTextback to summary
public static String getRasConnectionStatusText(int connStatus)

Translate the connection status value to text

Parameters
connStatus:int

the connection status

Returns:String

the descriptive text

getRasErrorStringback to summary
public static String getRasErrorString(int code)

Get the RAS error description

Parameters
code:int

the error code

Returns:String

the RAS description

hangupRasConnectionback to summary
public static void hangupRasConnection(String connName) throws Ras32Exception

Hangup a connection by name

Parameters
connName:String

the connection name

Exceptions
Ras32Exception:
errors
hangupRasConnectionback to summary
public static void hangupRasConnection(WinNT.HANDLE hrasConn) throws Ras32Exception

Hangup a connection

Parameters
hrasConn:WinNT.HANDLE

the connection

Exceptions
Ras32Exception:
errors
setPhoneBookEntryback to summary
public static void setPhoneBookEntry(String entryName, WinRas.RASENTRY.ByReference rasEntry) throws Ras32Exception

Set a phone book entry

Parameters
entryName:String

the phone book entry name

rasEntry:WinRas.RASENTRY.ByReference

the entry parameters

Exceptions
Ras32Exception:
errors
com.sun.jna.platform.win32 back to summary

public Class Rasapi32Util.Ras32Exception

extends RuntimeException
Class Inheritance

Exceptions

Field Summary

Modifier and TypeField and Description
private final int
private static final long

Constructor Summary

AccessConstructor and Description
public
Ras32Exception(int
Error code.
code
)

New Win32 exception from an error code, usually obtained from GetLastError.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

Error code.
getCode
()

Returns the error code of the error.

Field Detail

codeback to summary
private final int code
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

Ras32Exceptionback to summary
public Ras32Exception(int code)

New Win32 exception from an error code, usually obtained from GetLastError.

Parameters
code:int

Error code.

Method Detail

getCodeback to summary
public int getCode()

Returns the error code of the error.

Returns:int

Error code.