#include <threadcontrollerimpl.h>
Public Member Functions | |
| virtual void | initialize (uint16_t num_command_executers) |
| Initializes the ThreadController creating the indicated number of IkeSaExecuters. | |
| virtual void | startThread (Runnable &runnable)=0 |
| Starts the execution of a Runneble object. | |
| virtual auto_ptr< Condition > | getCondition ()=0 |
| Gets a new Condition object. | |
| virtual auto_ptr< Mutex > | getMutex ()=0 |
| Gets a new Mutex object. | |
| virtual auto_ptr< Semaphore > | getSemaphore (uint32_t initial_value)=0 |
| Creates a new implementation dependent Semaphore object. | |
| virtual void | incHalfOpenCounter () |
| Increments the half-opened IKE SAs counter. | |
| virtual void | decHalfOpenCounter () |
| Decrements the half-opened IKE SAs counter. | |
| virtual bool | useCookies () |
| Indicates the the cookie mechanism must be used with the current number of half-opened IKE_SA. | |
| virtual IkeSaController & | getWaitingIkeSaController () |
| Gets the next IkeSaController from the waiting queue. | |
| virtual void | addWaitingIkeSaController (IkeSaController &ike_sa_controller) |
| Adds an IkeSaController to the waiting queue. | |
| virtual uint64_t | nextSpi ()=0 |
| Gets the next SPI value. | |
| virtual void | addIkeSaController (auto_ptr< IkeSaController > ike_sa_controller) |
| Adds an IkeSaController to the collection. | |
| virtual void | requestChildSa (IpAddress &src_addr, IpAddress &dst_addr, auto_ptr< ChildSa > child_sa) |
| Request the creation of an CHILD_SA. | |
| virtual 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) |
| virtual void | deleteIkeSaController (IkeSaController &ike_sa_controller) |
| Removes the IkeSaController from the collection and deletes it. | |
| virtual bool | pushCommandBySpi (uint64_t spi, auto_ptr< Command > command, bool priority) |
| Push a Command into an IkeSaController by SPI value. | |
| virtual bool | pushCommandByAddress (const IpAddress &addr, const IpAddress &peer_addr, auto_ptr< Command > command, bool priority) |
| Push a Command into an IkeSaController by address. | |
| virtual void | closeAllSas () |
| Deletes all the IKE_SAs and CHILD_SAs sending deletion INFORMATIONAL exchanges. | |
| virtual void | exit () |
| Sets the exit flag. | |
| virtual bool | isExiting () |
| Gets the exit flag value. | |
Protected Attributes | |
| map< uint64_t, IkeSaController * > | ike_sa_collection |
| Active IKE_SA collection. | |
| auto_ptr< Mutex > | mutex_ike_sa_collection |
| Mutex to control active IKE_SAs collection accesses. | |
| deque< IkeSaController * > | waiting_ike_sa_controller |
| IKE_SA_Controllers waiting for a free IkeSaExecuter. | |
| auto_ptr< Condition > | condition_ike_sa_executer |
| Condition to synchronize the IkeSaExecuters. | |
| bool | exiting |
| Mark if the we want to exit. | |
| uint32_t | half_open_counter |
| Half open IKE SA counter. | |
| auto_ptr< Mutex > | mutex_half_open_counter |
| Mutex to control half-open counter accesses. | |
| void openikev2::ThreadControllerImpl::initialize | ( | uint16_t | num_command_executers | ) | [virtual] |
Initializes the ThreadController creating the indicated number of IkeSaExecuters.
| num_command_executers |
| virtual void openikev2::ThreadControllerImpl::startThread | ( | Runnable & | runnable | ) | [pure virtual] |
| virtual auto_ptr<Condition> openikev2::ThreadControllerImpl::getCondition | ( | ) | [pure virtual] |
| virtual auto_ptr<Mutex> openikev2::ThreadControllerImpl::getMutex | ( | ) | [pure virtual] |
| virtual auto_ptr<Semaphore> openikev2::ThreadControllerImpl::getSemaphore | ( | uint32_t | initial_value | ) | [pure virtual] |
| bool openikev2::ThreadControllerImpl::useCookies | ( | ) | [virtual] |
Indicates the the cookie mechanism must be used with the current number of half-opened IKE_SA.
| IkeSaController & openikev2::ThreadControllerImpl::getWaitingIkeSaController | ( | ) | [virtual] |
Gets the next IkeSaController from the waiting queue.
| void openikev2::ThreadControllerImpl::addWaitingIkeSaController | ( | IkeSaController & | ike_sa_controller | ) | [virtual] |
Adds an IkeSaController to the waiting queue.
| ike_sa_controller | An IkeSaController waiting for a free IkeSaExecuter |
| virtual uint64_t openikev2::ThreadControllerImpl::nextSpi | ( | ) | [pure virtual] |
Gets the next SPI value.
| void openikev2::ThreadControllerImpl::addIkeSaController | ( | auto_ptr< IkeSaController > | ike_sa_controller | ) | [virtual] |
| void openikev2::ThreadControllerImpl::requestChildSa | ( | IpAddress & | src_addr, | |
| IpAddress & | dst_addr, | |||
| auto_ptr< ChildSa > | child_sa | |||
| ) | [virtual] |
Request the creation of an CHILD_SA.
If exists a suittable IKE_SA, then uses it. Otherwise, a new IKE_SA will be created.
| 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::ThreadControllerImpl::deleteIkeSaController | ( | IkeSaController & | ike_sa_controller | ) | [virtual] |
Removes the IkeSaController from the collection and deletes it.
| controller | IkeSaController to be deleted |
| bool openikev2::ThreadControllerImpl::pushCommandBySpi | ( | uint64_t | spi, | |
| auto_ptr< Command > | command, | |||
| bool | priority | |||
| ) | [virtual] |
Push a Command into an IkeSaController by SPI value.
| 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 |
| bool openikev2::ThreadControllerImpl::pushCommandByAddress | ( | const IpAddress & | addr, | |
| const IpAddress & | peer_addr, | |||
| auto_ptr< Command > | command, | |||
| bool | priority | |||
| ) | [virtual] |
Push a Command into an IkeSaController by address.
| 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 |
| void openikev2::ThreadControllerImpl::exit | ( | ) | [virtual] |
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::ThreadControllerImpl::isExiting | ( | ) | [virtual] |
Gets the exit flag value.
1.5.1