Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

PRemoteConnection Class Reference

#include <remconn.h>

Inheritance diagram for PRemoteConnection:

PObject List of all members.

Error/Status functions

enum  Status {
  Idle, Connected, InProgress, LineBusy,
  NoDialTone, NoAnswer, PortInUse, NoNameOrNumber,
  AccessDenied, HardwareFailure, GeneralFailure, ConnectionLost,
  NotInstalled, NumStatuses
}
 Status codes for remote connection. More...

Status GetStatus () const
DWORD GetErrorCode () const

Information functions

const PStringGetName () const
PString GetAddress ()
PStringArray GetAvailableNames ()

Configuration functions

Status GetConfiguration (Configuration &config)
Status SetConfiguration (const Configuration &config, BOOL create=FALSE)
Status GetConfiguration (const PString &name, Configuration &config)
Status SetConfiguration (const PString &name, const Configuration &config, BOOL create=FALSE)
Status RemoveConfiguration (const PString &name)

Public Types


Public Methods

Construction
 PRemoteConnection ()
 Create a new remote connection.

 PRemoteConnection (const PString &name)
 ~PRemoteConnection ()
 Disconnect remote connection.

Overrides from class PObject
virtual Comparison Compare (const PObject &obj) const
virtual PINDEX HashFunction () const
Dial/Hangup functions
BOOL Open (BOOL existing=FALSE)
BOOL Open (const PString &name, BOOL existing=FALSE)
BOOL Open (const PString &name, const PString &username, const PString &password, BOOL existing=FALSE)
void Close ()

Protected Attributes

PString remoteName
PString userName
PString password
DWORD osError
PString pppDeviceName
PPipeChannelpipeChannel
BOOL wasConnected
Status status
PString deviceStr

Detailed Description

Remote Access Connection class.


Member Enumeration Documentation

enum PRemoteConnection::Status
 

Status codes for remote connection.

Enumeration values:
Idle  Connection has not been made and no attempt is being made.
Connected  Connection is completed and active.
InProgress  Connection is in progress.
LineBusy  Connection failed due to the line being busy.
NoDialTone  Connection failed due to the line havin no dial tone.
NoAnswer  Connection failed due to the remote not answering.
PortInUse  Connection failed due to the port being in use.
NoNameOrNumber  Connection failed due to the RAS setting name/number being incorrect.
AccessDenied  Connection failed due to insufficient privilege.
HardwareFailure  Connection failed due to a hardware failure.
GeneralFailure  Connection failed due to a general failure.
ConnectionLost  Connection was lost after successful establishment.
NotInstalled  The Remote Access Operating System support is not installed.
NumStatuses 


Constructor & Destructor Documentation

PRemoteConnection::PRemoteConnection  
 

Create a new remote connection.

PRemoteConnection::PRemoteConnection const PString   name
 

Create a new remote connection. This will initiate the connection using the specified settings.

Parameters:
name  Name of RAS configuration.

PRemoteConnection::~PRemoteConnection  
 

Disconnect remote connection.


Member Function Documentation

void PRemoteConnection::Close  
 

Close the remote connection. This will hang up/dosconnect the connection, net access will no longer be available to this site.

virtual Comparison PRemoteConnection::Compare const PObject   obj const [virtual]
 

Compare two connections.

Returns:
EqualTo of same RAS connectionconfiguration.
Parameters:
obj  Another connection instance.

Reimplemented from PObject.

PString PRemoteConnection::GetAddress  
 

Get the IP address in dotted decimal form for the RAS connection.

Returns:
String for IP address, or empty string if none.

PStringArray PRemoteConnection::GetAvailableNames   [static]
 

Get an array of names for all of the available remote connections on this system.

Returns:
Array of strings for remote connection names.

Status PRemoteConnection::GetConfiguration const PString   name,
Configuration   config
[static]
 

Get the configuration of the specified remote access connection.

Returns:
Connected# if the configuration information was obtained, NoNameOrNumber# if the particular RAS name does not exist, NotInstalled# if there is no RAS support in the operating system, GeneralFailure# on any other error.
Parameters:
config  Remote connection name to get configuration

Status PRemoteConnection::GetConfiguration Configuration   config
 

Get the configuration of the specified remote access connection.

Returns:
Connected# if the configuration information was obtained, NoNameOrNumber# if the particular RAS name does not exist, NotInstalled# if there is no RAS support in the operating system, GeneralFailure# on any other error.
Parameters:
config  Configuration of remote connection

DWORD PRemoteConnection::GetErrorCode   const [inline]
 

Get the error code for the last operation.

Returns:
Operating system error code.

const PString& PRemoteConnection::GetName   const [inline]
 

Get the name of the RAS connection.

Returns:
String for IP address, or empty string if none.

Status PRemoteConnection::GetStatus  
 

Get the current status of the RAS connection.

Returns:
Status code.

virtual PINDEX PRemoteConnection::HashFunction   [virtual]
 

Get has value for the connection

Returns:
Hash value of the connection name string.

Reimplemented from PObject.

BOOL PRemoteConnection::Open const PString   name,
const PString   username,
const PString   password,
BOOL    existing = FALSE
 

Open the remote connection.

Parameters:
username  RAS name of of connection to open.
password  Username for remote log in.
existing  password for remote log in. Flag for open only if already connected.

BOOL PRemoteConnection::Open const PString   name,
BOOL    existing = FALSE
 

Open the remote connection.

Parameters:
existing  RAS name of of connection to open. Flag for open only if already connected.

BOOL PRemoteConnection::Open BOOL    existing = FALSE
 

Open the remote connection.

Parameters:
existing  Flag for open only if already connected.

Status PRemoteConnection::RemoveConfiguration const PString   name [static]
 

Remove the specified remote access connection.

Returns:
Connected# if the configuration information was removed, NoNameOrNumber# if the particular RAS name does not exist, NotInstalled# if there is no RAS support in the operating system, GeneralFailure# on any other error.
Parameters:
name  Remote connection name to configure

Status PRemoteConnection::SetConfiguration const PString   name,
const Configuration   config,
BOOL    create = FALSE
[static]
 

Set the configuration of the specified remote access connection.

Returns:
Connected# if the configuration information was set, NoNameOrNumber# if the particular RAS name does not exist, NotInstalled# if there is no RAS support in the operating system, GeneralFailure# on any other error.
Parameters:
config  Remote connection name to configure
create  Configuration of remote connection Flag to create connection if not present

Status PRemoteConnection::SetConfiguration const Configuration   config,
BOOL    create = FALSE
 

Set the configuration of the specified remote access connection.

Returns:
Connected# if the configuration information was set, NoNameOrNumber# if the particular RAS name does not exist, NotInstalled# if there is no RAS support in the operating system, GeneralFailure# on any other error.
Parameters:
create  Configuration of remote connection Flag to create connection if not present


Member Data Documentation

PString PRemoteConnection::deviceStr [protected]
 

DWORD PRemoteConnection::osError [protected]
 

PString PRemoteConnection::password [protected]
 

PPipeChannel* PRemoteConnection::pipeChannel [protected]
 

PString PRemoteConnection::pppDeviceName [protected]
 

PString PRemoteConnection::remoteName [protected]
 

Status PRemoteConnection::status [protected]
 

PString PRemoteConnection::userName [protected]
 

BOOL PRemoteConnection::wasConnected [protected]
 


The documentation for this class was generated from the following file:
Generated on Fri Aug 13 15:50:09 2004 for PWLib by doxygen1.2.18