openikev2::Configuration Class Reference

This class keeps all the libopenikev2 configuration. More...

#include <configuration.h>

Inheritance diagram for openikev2::Configuration:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual void setGeneralConfiguration (auto_ptr< GeneralConfiguration > general_configuration)
 Changes the GeneralConfiguration of the Configuration.
virtual void setAnonymousConfiguration (auto_ptr< PeerConfiguration > anonymous_configuration)
 Changes the AnonymousConfiguration of the Configuration.
virtual void addPeerConfiguration (auto_ptr< PeerConfiguration > peer_configuration)
 Adds a new PeerConfiguration to the Configuration.
virtual void deletePeerConfiguration (ID &peer_id, Enums::ROLE_ID role)
 Deletes a PeerConfiguration.
virtual auto_ptr< IpsecConfigurationgetIpsecConfiguration (ID &peer_id, Enums::ROLE_ID role)
 Gets a copy of the IPSEC Configuration to be applied when talking with indicated peer ID acting as indicated role.
virtual auto_ptr< IkeConfigurationgetIkeConfiguration (ID &peer_id, Enums::ROLE_ID role)
 Gets a copy of the IKE Configuration to be applied when talking with indicated peer ID acting as indicated role.
virtual auto_ptr< GeneralConfigurationgetGeneralConfiguration ()
 Gets a copy of the GeneralConfiguration.
virtual string toStringTab (uint8_t tabs) const
 Construct a textual representation of the object, preceded of a num of tabs of size TAB_SIZE.

Static Public Member Functions

static ConfigurationgetInstance ()
 Gets the unique Singleton instance.
static void deleteConfiguration ()
 Deletes the unique Configuration instance.

Protected Member Functions

virtual PeerConfigurationgetPeerConfiguration (ID &peer_id, Enums::ROLE_ID role)
 Gets a copy of the PeerConfiguration to be applied with indicated peer ID and role.
 Configuration ()
 Creates a default Configuration.

Protected Attributes

AutoVector< PeerConfigurationpeer_configuration
 Peer configurations.
auto_ptr< PeerConfigurationanonymous_configuration
 Anonymos configuration.
auto_ptr< GeneralConfigurationgeneral_configuration
 General configuration.
auto_ptr< Mutexmutex_config
 Mutex to protect configuration accesses.

Static Protected Attributes

static Configurationinstance
 Singleton unique intance.

Detailed Description

This class keeps all the libopenikev2 configuration.

It follows the Singleton design pattern.

Author:
Pedro J. Fernandez Ruiz, Alejandro Perez Mendez <pedroj.fernandez@dif.um.es, alejandro_perez@dif.um.es>


Member Function Documentation

PeerConfiguration * openikev2::Configuration::getPeerConfiguration ( ID peer_id,
Enums::ROLE_ID  role 
) [protected, virtual]

Gets a copy of the PeerConfiguration to be applied with indicated peer ID and role.

Parameters:
peer_id Peer ID
role Our role
Returns:
A copy of the PeerConfiguration. NULL if none can be applied.

Configuration & openikev2::Configuration::getInstance (  )  [static]

Gets the unique Singleton instance.

Returns:
The unique Configuration instance.

void openikev2::Configuration::setGeneralConfiguration ( auto_ptr< GeneralConfiguration general_configuration  )  [virtual]

Changes the GeneralConfiguration of the Configuration.

Parameters:
general_configuration New GeneralConfiguration to be used.

void openikev2::Configuration::setAnonymousConfiguration ( auto_ptr< PeerConfiguration anonymous_configuration  )  [virtual]

Changes the AnonymousConfiguration of the Configuration.

Deletes the old one.

Parameters:
anonymous_configuration New AnonymousConfiguration.

void openikev2::Configuration::addPeerConfiguration ( auto_ptr< PeerConfiguration peer_configuration  )  [virtual]

Adds a new PeerConfiguration to the Configuration.

Parameters:
peer_configuration New PeerConfiguration to be added.

void openikev2::Configuration::deletePeerConfiguration ( ID peer_id,
Enums::ROLE_ID  role 
) [virtual]

Deletes a PeerConfiguration.

If PeerConfiguration contains more than one peer ID, the indicated ID is removed from the list. If the indicated peer ID is the only one contained in the PeerConfiguration, the entire PeerConfiguration is deleted.

Parameters:
peer_id Peer ID to be removed.
role Our role.

auto_ptr< IpsecConfiguration > openikev2::Configuration::getIpsecConfiguration ( ID peer_id,
Enums::ROLE_ID  role 
) [virtual]

Gets a copy of the IPSEC Configuration to be applied when talking with indicated peer ID acting as indicated role.

Parameters:
peer_id Peer ID.
role Our role.
Returns:
Copy of the IPSEC Configuration to be applied. If there aren't any matching PeerConfiguration, then returns the AnonymousConfiguration (if not NULL and if applicable). Otherwise returns NULL.

auto_ptr< IkeConfiguration > openikev2::Configuration::getIkeConfiguration ( ID peer_id,
Enums::ROLE_ID  role 
) [virtual]

Gets a copy of the IKE Configuration to be applied when talking with indicated peer ID acting as indicated role.

Parameters:
peer_id Peer ID.
role Our role.
Returns:
Copy of the IKE Configuration to be applied. If there aren't any matching PeerConfiguration, then returns the AnonymousConfiguration (if not NULL and applicable). Otherwise returns NULL.

auto_ptr< GeneralConfiguration > openikev2::Configuration::getGeneralConfiguration (  )  [virtual]

Gets a copy of the GeneralConfiguration.

Returns:
Copy of the GeneralConfiguration.

string openikev2::Configuration::toStringTab ( uint8_t  tabs  )  const [virtual]

Construct a textual representation of the object, preceded of a num of tabs of size TAB_SIZE.

Parameters:
tabs Num of tabs preceding the textual representation.
Returns:
Textual tabulated represetation of the object.

Implements openikev2::Printable.


Member Data Documentation

auto_ptr<PeerConfiguration> openikev2::Configuration::anonymous_configuration [protected]

Anonymos configuration.

This is applied when there is any PeerConfiguration available for that peer


Generated on Fri Jul 27 11:04:50 2007 for libopenikev2 by  doxygen 1.5.1