]>
Commit | Line | Data |
---|---|---|
c60c7694 MW |
1 | /** |
2 | * @file ike_rekey.h | |
3 | * | |
4 | * @brief Interface ike_rekey_t. | |
5 | * | |
6 | */ | |
7 | ||
8 | /* | |
9 | * Copyright (C) 2007 Martin Willi | |
10 | * Hochschule fuer Technik Rapperswil | |
11 | * | |
12 | * This program is free software; you can redistribute it and/or modify it | |
13 | * under the terms of the GNU General Public License as published by the | |
14 | * Free Software Foundation; either version 2 of the License, or (at your | |
15 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
16 | * | |
17 | * This program is distributed in the hope that it will be useful, but | |
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
19 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
20 | * for more details. | |
21 | */ | |
22 | ||
23 | #ifndef IKE_REKEY_H_ | |
24 | #define IKE_REKEY_H_ | |
25 | ||
26 | typedef struct ike_rekey_t ike_rekey_t; | |
27 | ||
28 | #include <library.h> | |
29 | #include <sa/ike_sa.h> | |
30 | #include <sa/tasks/task.h> | |
31 | ||
32 | /** | |
33 | * @brief Task of type IKE_REKEY, rekey an established IKE_SA. | |
34 | * | |
35 | * @b Constructors: | |
36 | * - ike_rekey_create() | |
37 | * | |
38 | * @ingroup tasks | |
39 | */ | |
40 | struct ike_rekey_t { | |
41 | ||
42 | /** | |
43 | * Implements the task_t interface | |
44 | */ | |
45 | task_t task; | |
eef08590 MW |
46 | |
47 | /** | |
48 | * @brief Register a rekeying task which collides with this one. | |
49 | * | |
50 | * If two peers initiate rekeying at the same time, the collision must | |
51 | * be handled gracefully. The task manager is aware of what exchanges | |
52 | * are going on and notifies the outgoing task by passing the incoming. | |
53 | * | |
54 | * @param this task initated by us | |
55 | * @param other incoming task | |
56 | */ | |
57 | void (*collide)(ike_rekey_t* this, task_t *other); | |
c60c7694 MW |
58 | }; |
59 | ||
60 | /** | |
61 | * @brief Create a new IKE_REKEY task. | |
62 | * | |
63 | * @param ike_sa IKE_SA this task works for | |
64 | * @param initiator TRUE for initiator, FALSE for responder | |
65 | * @return IKE_REKEY task to handle by the task_manager | |
66 | */ | |
67 | ike_rekey_t *ike_rekey_create(ike_sa_t *ike_sa, bool initiator); | |
68 | ||
69 | #endif /* IKE_REKEY_H_ */ |