updated Doxyfile
[strongswan.git] / src / charon / sa / mediation_manager.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 mediation_manager mediation_manager
20 * @{ @ingroup sa
21 */
22
23 #ifndef MEDIATION_MANAGER_H_
24 #define MEDIATION_MANAGER_H_
25
26 typedef struct mediation_manager_t mediation_manager_t;
27
28 #include <sa/ike_sa_id.h>
29 #include <utils/identification.h>
30
31 /**
32 * The mediation manager is responsible for managing currently online
33 * peers and registered requests for offline peers on the mediation server.
34 */
35 struct mediation_manager_t {
36
37 /**
38 * Remove the IKE_SA of a peer.
39 *
40 * @param ike_sa_id the IKE_SA ID of the peer's SA
41 */
42 void (*remove) (mediation_manager_t* this, ike_sa_id_t *ike_sa_id);
43
44 /**
45 * Update the ike_sa_id that is assigned to a peer's ID. If the peer
46 * is new, it gets a new record assigned.
47 *
48 * @param peer_id the peer's ID
49 * @param ike_sa_id the IKE_SA ID of the peer's SA
50 */
51 void (*update_sa_id) (mediation_manager_t* this, identification_t *peer_id,
52 ike_sa_id_t *ike_sa_id);
53
54 /**
55 * Checks if a specific peer is online.
56 *
57 * @param peer_id the peer's ID
58 * @returns
59 * - IKE_SA ID of the peer's SA.
60 * - NULL, if the peer is not online.
61 */
62 ike_sa_id_t* (*check) (mediation_manager_t* this,
63 identification_t *peer_id);
64
65 /**
66 * Checks if a specific peer is online and registers the requesting
67 * peer if it is not.
68 *
69 * @param peer_id the peer's ID
70 * @param requester the requesters ID
71 * @returns
72 * - IKE_SA ID of the peer's SA.
73 * - NULL, if the peer is not online.
74 */
75 ike_sa_id_t* (*check_and_register) (mediation_manager_t* this,
76 identification_t *peer_id, identification_t *requester);
77
78 /**
79 * Destroys the manager with all data.
80 */
81 void (*destroy) (mediation_manager_t *this);
82 };
83
84 /**
85 * Create a manager.
86 *
87 * @returns mediation_manager_t object
88 */
89 mediation_manager_t *mediation_manager_create(void);
90
91 #endif /** MEDIATION_MANAGER_H_ @}*/