Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QVPNClient Class Reference

The QVPNClient class abstracts data and state of a virtual private network. More...

    #include <QVPNClient>

Inherits QObject.

Public Types

  • enum State { Disconnected, Pending, Connected }
  • enum Type { OpenVPN, IPSec }

Public Functions

  • 29 public functions inherited from QObject

Signals

Protected Functions

  • QVPNClient ( bool serverMode, QObject * parent = 0 )
  • QVPNClient ( bool serverMode, uint vpnID, QObject * parent = 0 )
  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QVPNClient class abstracts data and state of a virtual private network.

An instance of a QVPNClient can be created by using QVPNFactory. Qt Extended currently supports OpenVPN only. New VPN implementations must subclass this abstract class.

Each VPNClient instance operates in one of the follwoing two modes:

  • Client mode - This mode is the most common way of using a QVPNClient object. Any Qt Extended application that obtains a QVPNClient instance via QVPNFactory::create() will create such an object. Essentially the return instance acts as a thin wrapper that forwards the VPN requests to the QtopiaVpnManager.
  • Server mode - Only the QtopiaVpnManager can create such a QVPNObject instance. It performs the actual VPN operations by making the appropriate calls to the root file system.

Every VPN can be identified via a unique identifier returned by id(), has a name() and a type(). The VPN configuration can be changed via configure(). connect() will establish the VPN connection. Once the VPN has been started its state() will change from QVPNCLient::Disconnected to QVPNClient::Pending and eventually to QVPNClient::Connected. Each state change is indicated via the connectionStateChanged() signal. If an error occurs during the startup period the user can obtain a human-readable string describing the nature of the error.

If the user decides to delete a VPN connection cleanup() should be called to remove any configuration file that has been created previously. By default Qt Extended saves VPN configuration files in $HOME/Applications/Netork/vpn.

See also QVPNFactory.


Member Type Documentation

enum QVPNClient::State

This enum is used to describe the state of a VPN connection.

ConstantValueDescription
QVPNClient::Disconnected0The VPN connection is offline.
QVPNClient::Pending1The VPN connection is in a transitional phase between Disconnected and Connected.
QVPNClient::Connected20The VPN connection is active and can be used.

enum QVPNClient::Type

This enum is used to describe the type of a VPN connection.

ConstantValueDescription
QVPNClient::OpenVPN0VPN solution based on OpenVPN (for details see http://openvpn.net)
QVPNClient::IPSec20VPN solution based on IPSec (not yet implemented in Qt Extended and serves as place holder for future implementation)


Member Function Documentation

QVPNClient::QVPNClient ( bool serverMode, QObject * parent = 0 )   [protected]

Creates a new QVPNClient instance with the given parent. QVPNClient instances can only be created via QVPNFactory::create().

serverMode determines whether this VPN object operates in server mode. Qt Extended applications usually obtain client mode instances of QVPNClient. In this mode all request are forwarded to the QtopiaVpnManager which keeps a reference to a VPNClient instance running in server mode. This allows the synchronization of multiple VPN requests to the same VPN.

This constructor is used internally by QVPNFactory whenever the user creates a new VPN that doesn't exist yet.

See also QtopiaVpnManager and QVPNFactory.

QVPNClient::QVPNClient ( bool serverMode, uint vpnID, QObject * parent = 0 )   [protected]

Creates a new QVPNClient instance with the given parent. QVPNClient instances can only be created via QVPNFactory::create().

serverMode determines whether this VPN object operates in server mode. Qt Extended applications usually obtain client mode instances of QVPNClient. In this mode all request are forwarded to the QtopiaVpnManager which keeps a reference to a VPNClient instance running in server mode. This allows the synchronization of multiple VPN requests to the same VPN.

vpnID acts as an identifier for a particular VPN.

See also QtopiaVpnManager and QVPNFactory.

QVPNClient::~QVPNClient ()   [virtual]

Destroys the virtual private network.

void QVPNClient::cleanup ()   [pure virtual]

Deletes the VPN client and all files associated to it. This function does nothing if the client is still connected.

QDialog * QVPNClient::configure ( QWidget * parent = 0 )   [pure virtual]

Returns the default configuration dialog that is shown to the user when he configures this interface. parent is the parent widget for the returned dialog.

void QVPNClient::connect ()   [pure virtual]

This function starts the VPN connection.

void QVPNClient::connectionStateChanged ( bool error )   [signal]

This signal is emitted when the state of the VPN connection changes.

error will be set to true if an error occurred during the last state transition. A human-readable string of the error can be obtained via errorString()

This signal must be emitted by subclasses of QVPNClient when state transitions occur.

void QVPNClient::disconnect ()   [pure virtual]

This function stops the active connection.

QString QVPNClient::errorString () const

Returns a human-readable description of the last error that occurred. This is useful for presenting an error message to the user when receiving a connectionStateChanged() signal with the error argument set to true;

uint QVPNClient::id () const

Returns the unique ID of this virtual private network.

QString QVPNClient::name () const   [virtual]

Returns the user set name for this VPN.

State QVPNClient::state () const   [pure virtual]

Returns the current state of this VPN client.

See also QVPNClient::State.

Type QVPNClient::type () const   [pure virtual]

Returns the VPN client type.

See also QVPNClient::Type.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 85
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 19
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
Page suivante

Le Qt Quarterly au hasard

Logo

Requête de données génériques avec QtXmlPatterns et XQuery

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web