updated Doxyfile
[strongswan.git] / src / charon / sa / tasks / ike_me.h
1 /*
2 * Copyright (C) 2007 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 /**
19 * @defgroup ike_me ike_me
20 * @{ @ingroup tasks
21 */
22
23 #ifndef IKE_ME_H_
24 #define IKE_ME_H_
25
26 typedef struct ike_me_t ike_me_t;
27
28 #include <library.h>
29 #include <sa/ike_sa.h>
30 #include <sa/tasks/task.h>
31
32 /**
33 * Task of type IKE_ME, detects and handles IKE-ME extensions.
34 *
35 * This tasks handles the ME_MEDIATION Notify exchange to setup a mediation
36 * connection, allows to initiate mediated connections using ME_CONNECT
37 * exchanges and to request reflexive addresses from the mediation server using
38 * ME_ENDPOINT notifies.
39 *
40 * @note This task has to be activated before the IKE_AUTH task, because that
41 * task generates the IKE_SA_INIT message so that no more payloads can be added
42 * to it afterwards.
43 */
44 struct ike_me_t {
45
46 /**
47 * Implements the task_t interface
48 */
49 task_t task;
50
51 /**
52 * Initiates a connection with another peer (i.e. sends a ME_CONNECT
53 * to the mediation server)
54 *
55 * @param peer_id ID of the other peer (gets cloned)
56 */
57 void (*connect)(ike_me_t *this, identification_t *peer_id);
58
59 /**
60 * Responds to a ME_CONNECT from another peer (i.e. sends a ME_CONNECT
61 * to the mediation server)
62 *
63 * @param peer_id ID of the other peer (gets cloned)
64 * @param connect_id the connect ID as provided by the initiator (gets cloned)
65 */
66 void (*respond)(ike_me_t *this, identification_t *peer_id, chunk_t connect_id);
67
68 /**
69 * Sends a ME_CALLBACK to a peer that previously requested another peer.
70 *
71 * @param peer_id ID of the other peer (gets cloned)
72 */
73 void (*callback)(ike_me_t *this, identification_t *peer_id);
74
75 /**
76 * Relays data to another peer (i.e. sends a ME_CONNECT to the peer)
77 *
78 * Data gets cloned.
79 *
80 * @param requester ID of the requesting peer
81 * @param connect_id content of the ME_CONNECTID notify
82 * @param connect_key content of the ME_CONNECTKEY notify
83 * @param endpoints endpoints
84 * @param response TRUE if this is a response
85 */
86 void (*relay)(ike_me_t *this, identification_t *requester, chunk_t connect_id,
87 chunk_t connect_key, linked_list_t *endpoints, bool response);
88
89 };
90
91 /**
92 * Create a new ike_me task.
93 *
94 * @param ike_sa IKE_SA this task works for
95 * @param initiator TRUE if taks is initiated by us
96 * @return ike_me task to handle by the task_manager
97 */
98 ike_me_t *ike_me_create(ike_sa_t *ike_sa, bool initiator);
99
100 #endif /** IKE_ME_H_ @}*/