- fixed doxygen build
[strongswan.git] / Source / charon / config / connection_store.h
1 /**
2 * @file connection_store.h
3 *
4 * @brief Interface connection_store_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
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>.
16 *
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
20 * for more details.
21 */
22
23 #ifndef CONNECTION_STORE_H_
24 #define CONNECTION_STORE_H_
25
26 #include <types.h>
27 #include <config/connection.h>
28
29
30 typedef struct connection_store_t connection_store_t;
31
32 /**
33 * @brief The interface for a store of connection_t's.
34 *
35 * @b Constructors:
36 * - stroke_create()
37 *
38 * @ingroup config
39 */
40 struct connection_store_t {
41
42 /**
43 * @brief Returns a connection definition identified by two IDs.
44 *
45 * This call is usefull to get a connection identified by addresses.
46 * It may be used after kernel request for traffic protection.
47 * The returned connection gets created/cloned and therefore must
48 * be destroyed after usage.
49 *
50 * @param this calling object
51 * @param my_id own ID of connection
52 * @param other_id others ID of connection
53 * @return
54 * - connection_t, if found
55 * - NULL otherwise
56 */
57 connection_t *(*get_connection_by_ids) (connection_store_t *this, identification_t *my_id, identification_t *other_id);
58
59 /**
60 * @brief Returns a connection definition identified by two hosts.
61 *
62 * This call is useful to get a connection which is identified by IDs
63 * rather than addresses, e.g. for connection setup on user request.
64 * The returned connection gets created/cloned and therefore must
65 * be destroyed after usage.
66 *
67 * @param this calling object
68 * @param my_id own address of connection
69 * @param other_id others address of connection
70 * @return
71 * - connection_t, if found
72 * - NULL otherwise
73 */
74 connection_t *(*get_connection_by_hosts) (connection_store_t *this, host_t *my_host, host_t *other_host);
75
76 /**
77 * @brief Destroys a connection_store_t object.
78 *
79 * @param this calling object
80 */
81 void (*destroy) (connection_store_t *this);
82 };
83
84 #endif /*CONNECTION_STORE_H_*/