2 * @file mediation_manager.h
4 * @brief Interface of mediation_manager_t.
9 * Copyright (C) 2007 Tobias Brunner
10 * Hochschule fuer Technik Rapperswil
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>.
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
23 #ifndef MEDIATION_MANAGER_H_
24 #define MEDIATION_MANAGER_H_
26 typedef struct mediation_manager_t mediation_manager_t
;
28 #include <sa/ike_sa_id.h>
29 #include <utils/identification.h>
32 * @brief The mediation manager is responsible for managing currently online
33 * peers and registered requests for offline peers on the mediation server.
36 * - mediation_manager_create()
40 struct mediation_manager_t
{
43 * @brief Remove the IKE_SA of a peer.
45 * @param this the manager object
46 * @param ike_sa_id the IKE_SA ID of the peer's SA
48 void (*remove
) (mediation_manager_t
* this, ike_sa_id_t
*ike_sa_id
);
51 * @brief Update the ike_sa_id that is assigned to a peer's ID. If the peer
52 * is new, it gets a new record assigned.
54 * @param this the manager object
55 * @param peer_id the peer's ID
56 * @param ike_sa_id the IKE_SA ID of the peer's SA
58 void (*update_sa_id
) (mediation_manager_t
* this, identification_t
*peer_id
,
59 ike_sa_id_t
*ike_sa_id
);
62 * @brief Checks if a specific peer is online.
64 * @param this the manager object
65 * @param peer_id the peer's ID
67 * - IKE_SA ID of the peer's SA.
68 * - NULL, if the peer is not online.
70 ike_sa_id_t
* (*check
) (mediation_manager_t
* this,
71 identification_t
*peer_id
);
74 * @brief Checks if a specific peer is online and registers the requesting
77 * @param this the manager object
78 * @param peer_id the peer's ID
79 * @param requester the requesters ID
81 * - IKE_SA ID of the peer's SA.
82 * - NULL, if the peer is not online.
84 ike_sa_id_t
* (*check_and_register
) (mediation_manager_t
* this,
85 identification_t
*peer_id
, identification_t
*requester
);
88 * @brief Destroys the manager with all data.
90 * @param this the manager object
92 void (*destroy
) (mediation_manager_t
*this);
96 * @brief Create a manager.
98 * @returns mediation_manager_t object
102 mediation_manager_t
*mediation_manager_create(void);
104 #endif /*MEDIATION_MANAGER_H_*/