]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/charon/config/backends/local_backend.h
restructured file layout
[thirdparty/strongswan.git] / src / charon / config / backends / local_backend.h
1 /**
2 * @file local_backend.h
3 *
4 * @brief Interface of local_backend_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2007 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 LOCAL_BACKEND_H_
24 #define LOCAL_BACKEND_H_
25
26 typedef struct local_backend_t local_backend_t;
27
28 #include <library.h>
29 #include <config/backends/backend.h>
30
31 /**
32 * @brief An in-memory backend to store configuration information.
33 *
34 * The local_backend_t stores the configuration in a simple list. Additional
35 * to the backend_t functionality, it adds the modification (add/remove).
36 *
37 * @b Constructors:
38 * - local_backend_create()
39 *
40 * @ingroup backends
41 */
42 struct local_backend_t {
43
44 /**
45 * Implements backend_t interface
46 */
47 backend_t backend;
48
49 /**
50 * @brief Add a peer_config to the backend.
51 *
52 * @param this calling object
53 * @param config peer_config to add to the backend
54 */
55 void (*add_peer_cfg)(local_backend_t *this, peer_cfg_t *config);
56
57 /**
58 * @brief Create an iterator over all peer configs.
59 *
60 * @param this calling object
61 * @return iterator over peer configs
62 */
63 iterator_t* (*create_peer_cfg_iterator)(local_backend_t *this);
64
65 /**
66 * @brief Destroy a local backend.
67 *
68 * @param this calling object
69 */
70 void (*destroy)(local_backend_t *this);
71 };
72
73 /**
74 * @brief Creates a local_backend_t instance.
75 *
76 * @return local_backend instance.
77 *
78 * @ingroup config
79 */
80 local_backend_t *local_backend_create(void);
81
82 #endif /* LOCAL_BACKEND_H_ */