96e76e05f4f890d6b966d2115372aced6d251170
[strongswan.git] / src / charon / config / backend.h
1 /*
2 * Copyright (C) 2007-2008 Martin Willi
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 backend backend
20 * @{ @ingroup config
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 <credentials/auth_info.h>
32 #include <utils/linked_list.h>
33
34 /**
35 * The interface for a configuration backend.
36 *
37 * A configuration backend is loaded into the backend_manager. It does the actual
38 * configuration lookup for the method it implements. See backend_manager_t for
39 * more information.
40 */
41 struct backend_t {
42
43 /**
44 * Create an enumerator over all IKE configs matching two hosts.
45 *
46 * Hosts may be NULL to get all.
47 *
48 * @param me address of local host
49 * @param other address of remote host
50 * @return enumerator over ike_cfg_t's
51 */
52 enumerator_t* (*create_ike_cfg_enumerator)(backend_t *this,
53 host_t *me, host_t *other);
54 /**
55 * Create an enumerator over all Peer configs matching two IDs.
56 *
57 * IDs may be NULL to get all.
58 *
59 * @param me identity of ourself
60 * @param other identity of remote host
61 * @return enumerator over peer_cfg_t
62 */
63 enumerator_t* (*create_peer_cfg_enumerator)(backend_t *this,
64 identification_t *me,
65 identification_t *other);
66 /**
67 * Get a peer_cfg identified by it's name, or a name of its child.
68 *
69 * @param name name of peer/child cfg
70 * @return matching peer_config, or NULL if none found
71 */
72 peer_cfg_t *(*get_peer_cfg_by_name)(backend_t *this, char *name);
73 };
74
75 #endif /* BACKEND_H_ @} */