]>
Commit | Line | Data |
---|---|---|
17d92e97 MW |
1 | /* |
2 | * Copyright (C) 2007 Martin Willi | |
19ef2aec TB |
3 | * |
4 | * Copyright (C) secunet Security Networks AG | |
17d92e97 MW |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
552cc11b MW |
15 | */ |
16 | ||
17 | /** | |
18 | * @defgroup ike_mobike ike_mobike | |
22bf44c8 | 19 | * @{ @ingroup tasks_v2 |
17d92e97 MW |
20 | */ |
21 | ||
22 | #ifndef IKE_MOBIKE_H_ | |
23 | #define IKE_MOBIKE_H_ | |
24 | ||
25 | typedef struct ike_mobike_t ike_mobike_t; | |
26 | ||
27 | #include <library.h> | |
28 | #include <sa/ike_sa.h> | |
15a682f4 | 29 | #include <sa/task.h> |
fdee6b5f | 30 | #include <networking/packet.h> |
17d92e97 MW |
31 | |
32 | /** | |
552cc11b | 33 | * Task of type ike_mobike, detects and handles MOBIKE extension. |
17d92e97 MW |
34 | * |
35 | * The MOBIKE extension is defined in RFC4555. It allows to update IKE | |
36 | * and IPsec tunnel addresses. | |
37 | * This tasks handles the MOBIKE_SUPPORTED notify exchange to detect MOBIKE | |
38 | * support, allows the exchange of ADDITIONAL_*_ADDRESS to exchange additional | |
7daf5226 | 39 | * endpoints and handles the UPDATE_SA_ADDRESS notify to finally update |
17d92e97 | 40 | * endpoints. |
17d92e97 MW |
41 | */ |
42 | struct ike_mobike_t { | |
43 | ||
44 | /** | |
45 | * Implements the task_t interface | |
46 | */ | |
47 | task_t task; | |
7daf5226 | 48 | |
13876431 TB |
49 | /** |
50 | * Use the task to update the list of additional addresses. | |
51 | */ | |
52 | void (*addresses)(ike_mobike_t *this); | |
53 | ||
17d92e97 | 54 | /** |
552cc11b | 55 | * Use the task to roam to other addresses. |
17d92e97 | 56 | * |
3bc62fe7 | 57 | * @param address TRUE to include address list update |
17d92e97 | 58 | */ |
3bc62fe7 | 59 | void (*roam)(ike_mobike_t *this, bool address); |
7daf5226 | 60 | |
9d9a772e MW |
61 | /** |
62 | * Use the task for a DPD check which detects changes in NAT mappings. | |
63 | */ | |
64 | void (*dpd)(ike_mobike_t *this); | |
7daf5226 | 65 | |
5474dc65 | 66 | /** |
89bd016e | 67 | * Transmission hook, called by task manager. |
5474dc65 | 68 | * |
7daf5226 | 69 | * The task manager calls this hook whenever it transmits a packet. It |
5474dc65 MW |
70 | * allows the mobike task to send the packet on multiple paths to do path |
71 | * probing. | |
72 | * | |
5474dc65 | 73 | * @param packet the packet to transmit |
7840952e | 74 | * @return TRUE if transmitted, FALSE if no path found |
5474dc65 | 75 | */ |
7840952e | 76 | bool (*transmit)(ike_mobike_t *this, packet_t *packet); |
7daf5226 | 77 | |
f215e919 | 78 | /** |
552cc11b | 79 | * Check if this task is probing for routability. |
f215e919 | 80 | * |
f215e919 MW |
81 | * @return TRUE if task is probing |
82 | */ | |
7daf5226 | 83 | bool (*is_probing)(ike_mobike_t *this); |
2180ace9 TB |
84 | |
85 | /** | |
86 | * Enable probing for routability. | |
87 | */ | |
88 | void (*enable_probing)(ike_mobike_t *this); | |
17d92e97 MW |
89 | }; |
90 | ||
91 | /** | |
552cc11b | 92 | * Create a new ike_mobike task. |
17d92e97 MW |
93 | * |
94 | * @param ike_sa IKE_SA this task works for | |
784d96e0 | 95 | * @param initiator TRUE if task is initiated by us |
b9b8a98f | 96 | * @return ike_mobike task to handle by the task_manager |
17d92e97 MW |
97 | */ |
98 | ike_mobike_t *ike_mobike_create(ike_sa_t *ike_sa, bool initiator); | |
99 | ||
1490ff4d | 100 | #endif /** IKE_MOBIKE_H_ @}*/ |