openikev2::ThreadController Class Reference

This class allows to manage threads using several concrete implementations. More...

#include <threadcontroller.h>

List of all members.

Static Public Member Functions

static void setImplementation (auto_ptr< ThreadControllerImpl > implementation, uint16_t num_command_executers)
 Sets the desired Thread Controller implementation.
static void startThread (Runnable &runnable)
 Starts the execution of a Runnable object.
static auto_ptr< ConditiongetCondition ()
 Gets a new Condition object.
static auto_ptr< MutexgetMutex ()
 Gets a new Mutex object.
static auto_ptr< SemaphoregetSemaphore (uint32_t initial_value)
 Creates a new implementation dependent Semaphore object.
static void incHalfOpenCounter ()
 Increments the half-opened IKE SAs counter.
static void decHalfOpenCounter ()
 Decrements the half-opened IKE SAs counter.
static bool useCookies ()
 Indicates the the cookie mechanism must be used with the current number of half-opened IKE_SA.
static IkeSaControllergetWaitingIkeSaController ()
 Gets the next IkeSaController from the waiting queue.
static void addWaitingIkeSaController (IkeSaController &ike_sa_controller)
 Adds an IkeSaController to the waiting queue.
static uint64_t nextSpi ()
 Gets the next SPI value.
static void addIkeSaController (auto_ptr< IkeSaController > ike_sa_controller)
 Adds an IkeSaController to the collection.
static void requestChildSa (IpAddress &src_addr, IpAddress &dst_addr, auto_ptr< ChildSa > child_sa)
 Request the creation of an CHILD_SA.
static void requestChildSa (IpAddress &src_addr, IpAddress &dst_addr, Enums::PROTOCOL_ID ipsec_protocol, Enums::IPSEC_MODE mode, auto_ptr< Payload_TSi > payload_ts_i, auto_ptr< Payload_TSr > payload_ts_r, uint32_t request_id)
static void deleteIkeSaController (IkeSaController &ike_sa_controller)
 Removes the IkeSaController from the collection and deletes it.
static bool pushCommandBySpi (uint64_t spi, auto_ptr< Command > command, bool priority)
 Push a Command into an IkeSaController by SPI value.
static bool pushCommandByAddress (const IpAddress &addr, const IpAddress &peer_addr, auto_ptr< Command > command, bool priority)
 Push a Command into an IkeSaController by address.
static void closeAllSas ()
 Deletes all the IKE_SAs and CHILD_SAs sending deletion INFORMATIONAL exchanges.
static void exit ()
 Sets the exit flag.
static bool isExiting ()
 Gets the exit flag value.

Static Protected Attributes

static auto_ptr< ThreadControllerImplimplementation
 Thread Controller implementation to be used.


Detailed Description

This class allows to manage threads using several concrete implementations.

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


Member Function Documentation

void openikev2::ThreadController::setImplementation ( auto_ptr< ThreadControllerImpl implementation,
uint16_t  num_command_executers 
) [static]

Sets the desired Thread Controller implementation.

Parameters:
implementation Desired Thread Controller implementation .

void openikev2::ThreadController::startThread ( Runnable runnable  )  [static]

Starts the execution of a Runnable object.

Parameters:
runnable Runnable object.

auto_ptr< Condition > openikev2::ThreadController::getCondition (  )  [static]

Gets a new Condition object.

Returns:
A new Condition object.

auto_ptr< Mutex > openikev2::ThreadController::getMutex (  )  [static]

Gets a new Mutex object.

Returns:
A new Mutex object.

auto_ptr< Semaphore > openikev2::ThreadController::getSemaphore ( uint32_t  initial_value  )  [static]

Creates a new implementation dependent Semaphore object.

Returns:
A new Semaphore object.

bool openikev2::ThreadController::useCookies (  )  [static]

Indicates the the cookie mechanism must be used with the current number of half-opened IKE_SA.

Returns:
TRUE if cookie mechanism must be used. FALSE otherwise

IkeSaController & openikev2::ThreadController::getWaitingIkeSaController (  )  [static]

Gets the next IkeSaController from the waiting queue.

Returns:
An IkeSaController waiting for a free IkeSaExecuter

void openikev2::ThreadController::addWaitingIkeSaController ( IkeSaController ike_sa_controller  )  [static]

Adds an IkeSaController to the waiting queue.

Parameters:
ike_sa_controller An IkeSaController waiting for a free IkeSaExecuter

uint64_t openikev2::ThreadController::nextSpi (  )  [static]

Gets the next SPI value.

Returns:
SPI value

void openikev2::ThreadController::addIkeSaController ( auto_ptr< IkeSaController ike_sa_controller  )  [static]

Adds an IkeSaController to the collection.

Parameters:
controller IkeSaController to be added

void openikev2::ThreadController::requestChildSa ( IpAddress src_addr,
IpAddress dst_addr,
auto_ptr< ChildSa child_sa 
) [static]

Request the creation of an CHILD_SA.

If exists a suittable IKE_SA, then uses it. Otherwise, a new IKE_SA will be created.

Parameters:
src_addr Source address for the IKE_SA
dst_addr Destination address for the IKE_SA
child_sa CHILD_SA to be created

void openikev2::ThreadController::deleteIkeSaController ( IkeSaController ike_sa_controller  )  [static]

Removes the IkeSaController from the collection and deletes it.

Parameters:
controller IkeSaController to be deleted

bool openikev2::ThreadController::pushCommandBySpi ( uint64_t  spi,
auto_ptr< Command command,
bool  priority 
) [static]

Push a Command into an IkeSaController by SPI value.

Parameters:
spi IkeSaController SPI value
command The Command to be pushed
priority The priority. TRUE if it must be inserted in the front and FALSE if it must be inserted in the back
Returns:
TRUE if the IKE_SA with the indicated SPI exists. FALSE otherwise

bool openikev2::ThreadController::pushCommandByAddress ( const IpAddress addr,
const IpAddress peer_addr,
auto_ptr< Command command,
bool  priority 
) [static]

Push a Command into an IkeSaController by address.

Parameters:
addr Source address of the IKE_SA
peer_addr Destination address of the IKE_SA
command The Command to be pushed
priority The priority. TRUE if it must be inserted in the front and FALSE if it must be inserted in the back
Returns:
TRUE if the IKE_SA with the indicated SPI exists. FALSE otherwise

void openikev2::ThreadController::exit (  )  [static]

Sets the exit flag.

When this flag is set, if all the SAs become closed, a new CLOSE_ALL_SAS event is sent

bool openikev2::ThreadController::isExiting (  )  [static]

Gets the exit flag value.

Returns:
The exit flag value


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