]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/charon/config/backends/backend.h
restructured file layout
[thirdparty/strongswan.git] / src / charon / config / backends / backend.h
1 /**
2 * @file backend.h
3 *
4 * @brief Interface backend_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 BACKEND_H_
24 #define BACKEND_H_
25
26 typedef struct backend_t backend_t;
27
28 #include <library.h>
29 #include <config/ike_cfg.h>
30 #include <config/peer_cfg.h>
31 #include <utils/linked_list.h>
32
33
34 /**
35 * @brief The interface for a configuration backend.
36 *
37 * @b Constructors:
38 * - implementations constructor, such as local_backend_create()
39 *
40 * @ingroup backends
41 */
42 struct backend_t {
43
44 /**
45 * @brief Get an ike_cfg identified by two hosts.
46 *
47 * @param this calling object
48 * @param my_host address of own host
49 * @param other_host address of remote host
50 * @return matching ike_config, or NULL if none found
51 */
52 ike_cfg_t *(*get_ike_cfg)(backend_t *this,
53 host_t *my_host, host_t *other_host);
54
55 /**
56 * @brief Get a peer_cfg identified by two IDs.
57 *
58 * @param this calling object
59 * @param my_id own ID
60 * @param other_id peers ID
61 * @return matching peer_config, or NULL if none found
62 */
63 peer_cfg_t *(*get_peer_cfg)(backend_t *this,
64 identification_t *my_id,
65 identification_t *other_id);
66
67 /**
68 * @brief Get a peer_cfg identified by its name.
69 *
70 * @param this calling object
71 * @param name configs name
72 * @return matching peer_config, or NULL if none found
73 */
74 peer_cfg_t *(*get_peer_cfg_by_name)(backend_t *this, char *name);
75 };
76
77 #endif /* BACKEND_H_ */