Commit Graph

38 Commits

Author SHA1 Message Date
Tobias Brunner 6b00d34b42 controller: Make child config optional for initiate() 2019-04-25 15:23:19 +02:00
Tobias Brunner 1b67166921 Unify format of HSR copyright statements 2018-05-23 16:32:53 +02:00
Tobias Brunner 7b72909774 controller: Add option to force destruction of an IKE_SA
It's optionally possible to wait for a timeout to destroy the SA.
2018-05-22 10:06:07 +02:00
Tobias Brunner a79d510354 ike-sa: Add option to force the destruction of an IKE_SA after initiating a delete 2018-05-22 10:06:07 +02:00
Tobias Brunner 485952ff83 controller: Remove special handling for routed CHILD_SAs when terminating
In very early versions routed CHILD_SAs were attached to IKE_SAs, since
that's not the case anymore (they are handled via trap manager), we can
remove this special handling.
2018-04-12 16:30:28 +02:00
Tobias Brunner 16898026a5 child-sa: Add new state to track deleted but not yet destroyed CHILD_SAs
This allows us to easily identify SAs we keep around after a rekeying to
process delayed packets.
2018-04-09 17:13:41 +02:00
Tobias Brunner ab7d5e32d3 controller: Consider any IKE_SA destruction as success when terminating 2017-09-25 18:40:55 +02:00
Tobias Brunner df9e512523 controller: Don't listen for CHILD_SA state changes when terminating IKE_SAs
We actually want to wait until the IKE_SA is destroyed, not any of the
CHILD_SAs (even though there might not be that much of a difference
depending on the number of CHILD_SAs).

Fixes #2261.
2017-03-02 09:10:48 +01:00
Tobias Brunner 0a72d68ea8 controller: Use separate callbacks to track termination and initiation of SAs
If a local authentication failure occurs in IKEv1 we delete the IKE_SA, which
we don't want the controller to detect as success.

Fixes #1449.
2016-06-06 13:57:58 +02:00
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Tobias Brunner 735f929ca7 ike: Only consider number of half-open SAs as responder when deciding whether COOKIEs are sent 2015-08-27 11:18:51 +02:00
Tobias Brunner ff0abde9ed controller: Optionally adhere to init limits also when initiating IKE_SAs 2015-08-21 18:21:13 +02:00
Martin Willi db80d0d2da ike-sa-manager: Remove IKE_SA checkout by CHILD_SA reqid 2015-02-20 13:34:51 +01:00
Martin Willi 971a91685d controller: Use the CHILD_SA unique_id to terminate CHILD_SAs 2015-02-20 13:34:50 +01:00
Martin Willi c39b0c883d controller: Keep following initiate() if the first DH guess was wrong 2014-11-21 12:51:19 +01:00
Martin Willi 87664d92ca controller: Remove unused <dlfcn.h> include 2014-06-04 15:53:03 +02:00
Martin Willi 5e9144a21f controller: clean up job data if a thread gets cancelled waiting in a function
Controller functions are thread cancellation points, so register a cancellation
handler cleaning up job data.
2013-05-06 15:28:26 +02:00
Martin Willi 83e2c81924 If controller operations have a callback, don't succeed before hook gets called 2013-03-07 12:17:01 +01:00
Martin Willi d19f0ae3e0 Don't modify the message string passed to logger, as it gets reused 2012-07-13 15:43:04 +02:00
Tobias Brunner 644c6c968d Use spin locks to update IKE_SAs in controller_t
This ensures the listeners don't miss any events after the SAs have been
checked out in the asynchronously executed jobs.  This is a matter of
memory visibility and not primary a matter of exclusive access.
2012-07-04 10:13:50 +02:00
Tobias Brunner c9355ea4a0 Fixed job handling in controller_t
Also IKE_SAs are now checked out in the jobs and not before.
2012-07-04 10:13:49 +02:00
Tobias Brunner 7fec83af28 Give processor_t more control over the lifecycle of a job
Jobs are now destroyed by the processor, but they are allowed to
reschedule themselves.  That is, parts of the reschedule functionality
already provided by callback_job_t is moved to the processor.  Not yet
fully supported is JOB_REQUEUE_DIRECT and canceling jobs.

Note: job_t.destroy() is now called not only for queued jobs but also
after execution or cancellation of jobs.  job_t.status can be used to
decide what to do in said method.
2012-06-25 17:10:28 +02:00
Tobias Brunner ead92870b8 Loggers specify what log messages they want to receive during registration.
This also allows us to generate the log message only once for all
loggers that need it (avoids calls to custom printf specifier callbacks).

To update the log levels loggers can simply be registered again.
2012-05-02 14:45:38 +02:00
Tobias Brunner 0e474f9148 Use a separate interface for loggers.
The new interface does not allow loggers to unregister themselves from
the bus.  This allows us to use a rwlock_t for them.

The latter also means that loggers can now be called concurrently by
multiple threads.
2012-05-02 14:45:38 +02:00
Tobias Brunner ecb5abd7fa Fixed return value of controller_t functions if callback returns FALSE. 2012-05-02 14:45:38 +02:00
Tobias Brunner 5a073784e2 Implement wait_for_listener in controller_t with semaphores.
This eliminates even the slightest chance of a deadlock.
2012-05-02 14:45:37 +02:00
Tobias Brunner b6e9c41861 Implement bus_t.listen() directly in controller_t (the only user).
This will hopefully allow us to later simplify bus_t.
2012-05-02 14:45:37 +02:00
Martin Willi 3a925f74ab Do not query CHILD_SA during delete if they already expired 2012-03-20 17:31:31 +01:00
Martin Willi 3d54ae94d9 Handle initiation of not supported IKE versions properly 2012-03-20 17:31:30 +01:00
Martin Willi 8e3f14baab bus->listen() and the controller wrappers accept a timeout to wait for callbacks 2011-08-26 10:44:25 +02:00
Tobias Brunner f3bb1bd039 Fixed common misspellings.
Mostly found by 'codespell'.
2011-07-20 16:14:10 +02:00
Tobias Brunner 4bbce1ef37 Replaced ike_sa_t.create_child_sa_iterator with enumerator.
This required two new methods on ike_sa_t. One returns the number of
CHILD_SAs and one allows to remove a CHILD_SA.
2011-07-06 09:43:45 +02:00
Tobias Brunner e26304348c Replaced simple iterator usages. 2011-07-06 09:43:45 +02:00
Martin Willi 4baf1f3bfe Migrated controller_t to INIT/METHOD macros 2011-05-16 15:24:15 +02:00
Martin Willi 83245de0ac Provide get_priority() method in controller jobs 2011-05-16 15:24:15 +02:00
Martin Willi 69c3eca0e9 Added a non-blocking, skipping variant of IKE_SA enumerator 2011-05-16 15:24:13 +02:00
Tobias Brunner dcab9d39a2 Fixed a possible segfault after termination of IKE and child SAs.
Because the thread that is actually terminating the SA and thus checking
it in again is not be the same thread that previously checked it out and
queued the termination job, the thread local SA on the bus has to be reset
manually, similar to how it is set in the job which is executing the job.
2011-02-28 13:29:09 +01:00
Tobias Brunner 08c5572602 Moving charon to libcharon. 2010-03-19 13:34:52 +01:00