PTLib
Version 2.10.4
|
Remote Access Connection class. More...
#include <remconn.h>
Classes | |
struct | Configuration |
Structure for a RAS configuration. More... | |
Public Member Functions | |
Construction | |
PRemoteConnection () | |
Create a new remote connection. | |
PRemoteConnection (const PString &name) | |
Create a new remote connection. | |
~PRemoteConnection () | |
Disconnect remote connection. | |
Overrides from class PObject | |
virtual Comparison | Compare (const PObject &obj) const |
Compare two connections. | |
virtual PINDEX | HashFunction () const |
Get has value for the connection. | |
Dial/Hangup functions | |
PBoolean | Open (PBoolean existing=false) |
Open the remote connection. | |
PBoolean | Open (const PString &name, PBoolean existing=false) |
Open the remote connection. | |
PBoolean | Open (const PString &name, const PString &username, const PString &password, PBoolean existing=false) |
Open the remote connection. | |
void | Close () |
Close the remote connection. | |
Protected Attributes | |
PString | remoteName |
PString | userName |
PString | password |
DWORD | osError |
PString | pppDeviceName |
PPipeChannel * | pipeChannel |
PBoolean | wasConnected |
Status | status |
PString | deviceStr |
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 |
Get the current status of the RAS connection. | |
DWORD | GetErrorCode () const |
Get the error code for the last operation. | |
Information functions | |
const PString & | GetName () const |
Get the name of the RAS connection. | |
PString | GetAddress () |
Get the IP address in dotted decimal form for the RAS connection. | |
static PStringArray | GetAvailableNames () |
Get an array of names for all of the available remote connections on this system. | |
Configuration functions | |
Status | GetConfiguration (Configuration &config) |
Get the configuration of the specified remote access connection. | |
Status | SetConfiguration (const Configuration &config, PBoolean create=false) |
Set the configuration of the specified remote access connection. | |
static Status | GetConfiguration (const PString &name, Configuration &config) |
Get the configuration of the specified remote access connection. | |
static Status | SetConfiguration (const PString &name, const Configuration &config, PBoolean create=false) |
Set the configuration of the specified remote access connection. | |
static Status | RemoveConfiguration (const PString &name) |
Remove the specified remote access connection. |
Remote Access Connection class.
Status codes for remote connection.
Create a new remote connection.
PRemoteConnection::PRemoteConnection | ( | const PString & | name | ) |
Create a new remote connection.
This will initiate the connection using the specified settings.
name | Name of RAS configuration. |
Disconnect remote connection.
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.
obj | Another connection instance. |
Reimplemented from PObject.
Get the IP address in dotted decimal form for the RAS connection.
static PStringArray PRemoteConnection::GetAvailableNames | ( | ) | [static] |
Get an array of names for all of the available remote connections on this system.
Status PRemoteConnection::GetConfiguration | ( | Configuration & | config | ) |
Get the configuration of the specified remote access connection.
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. config | Configuration of remote connection |
static Status PRemoteConnection::GetConfiguration | ( | const PString & | name, |
Configuration & | config | ||
) | [static] |
Get the configuration of the specified remote access connection.
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. name | Remote connection name to get configuration |
config | Configuration of remote connection |
DWORD PRemoteConnection::GetErrorCode | ( | ) | const [inline] |
const PString& PRemoteConnection::GetName | ( | ) | const [inline] |
Get the name of the RAS connection.
References remoteName.
Status PRemoteConnection::GetStatus | ( | ) | const |
Get the current status of the RAS connection.
virtual PINDEX PRemoteConnection::HashFunction | ( | ) | const [virtual] |
Get has value for the connection.
Reimplemented from PObject.
PBoolean PRemoteConnection::Open | ( | PBoolean | existing = false | ) |
Open the remote connection.
existing | Flag for open only if already connected. |
PBoolean PRemoteConnection::Open | ( | const PString & | name, |
PBoolean | existing = false |
||
) |
Open the remote connection.
name | RAS name of of connection to open. |
existing | Flag for open only if already connected. |
PBoolean PRemoteConnection::Open | ( | const PString & | name, |
const PString & | username, | ||
const PString & | password, | ||
PBoolean | existing = false |
||
) |
Open the remote connection.
name | RAS name of of connection to open. |
username | Username for remote log in. |
password | password for remote log in. |
existing | Flag for open only if already connected. |
static Status PRemoteConnection::RemoveConfiguration | ( | const PString & | name | ) | [static] |
Remove the specified remote access connection.
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. name | Remote connection name to configure |
Status PRemoteConnection::SetConfiguration | ( | const Configuration & | config, |
PBoolean | create = false |
||
) |
Set the configuration of the specified remote access connection.
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. config | Configuration of remote connection |
create | Flag to create connection if not present |
static Status PRemoteConnection::SetConfiguration | ( | const PString & | name, |
const Configuration & | config, | ||
PBoolean | create = false |
||
) | [static] |
Set the configuration of the specified remote access connection.
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. name | Remote connection name to configure |
config | Configuration of remote connection |
create | Flag to create connection if not present |
PString PRemoteConnection::deviceStr [protected] |
DWORD PRemoteConnection::osError [protected] |
Referenced by GetErrorCode().
PString PRemoteConnection::password [protected] |
PPipeChannel* PRemoteConnection::pipeChannel [protected] |
PString PRemoteConnection::pppDeviceName [protected] |
PString PRemoteConnection::remoteName [protected] |
Referenced by GetName().
Status PRemoteConnection::status [protected] |
PString PRemoteConnection::userName [protected] |
PBoolean PRemoteConnection::wasConnected [protected] |