2 * Copyright (C) 2007 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
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>.
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
17 * @defgroup mediation_manager mediation_manager
21 #ifndef MEDIATION_MANAGER_H_
22 #define MEDIATION_MANAGER_H_
24 typedef struct mediation_manager_t mediation_manager_t
;
26 #include <sa/ike_sa_id.h>
27 #include <utils/identification.h>
30 * The mediation manager is responsible for managing currently online
31 * peers and registered requests for offline peers on the mediation server.
33 struct mediation_manager_t
{
36 * Remove the IKE_SA of a peer.
38 * @param ike_sa_id the IKE_SA ID of the peer's SA
40 void (*remove
) (mediation_manager_t
* this, ike_sa_id_t
*ike_sa_id
);
43 * Update the ike_sa_id that is assigned to a peer's ID. If the peer
44 * is new, it gets a new record assigned.
46 * @param peer_id the peer's ID
47 * @param ike_sa_id the IKE_SA ID of the peer's SA
49 void (*update_sa_id
) (mediation_manager_t
* this, identification_t
*peer_id
,
50 ike_sa_id_t
*ike_sa_id
);
53 * Checks if a specific peer is online.
55 * @param peer_id the peer's ID
57 * - IKE_SA ID of the peer's SA.
58 * - NULL, if the peer is not online.
60 ike_sa_id_t
* (*check
) (mediation_manager_t
* this,
61 identification_t
*peer_id
);
64 * Checks if a specific peer is online and registers the requesting
67 * @param peer_id the peer's ID
68 * @param requester the requesters ID
70 * - IKE_SA ID of the peer's SA.
71 * - NULL, if the peer is not online.
73 ike_sa_id_t
* (*check_and_register
) (mediation_manager_t
* this,
74 identification_t
*peer_id
, identification_t
*requester
);
77 * Destroys the manager with all data.
79 void (*destroy
) (mediation_manager_t
*this);
85 * @returns mediation_manager_t object
87 mediation_manager_t
*mediation_manager_create(void);
89 #endif /** MEDIATION_MANAGER_H_ @}*/