accepting stroke initiation by a name of a child_cfg
[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 Get a peer_config identified by name, or a name of its child_cfgs.
59 *
60 * @param this calling object
61 * @param name name of the peer config
62 * @return matching peer_config, or NULL if none found
63 */
64 peer_cfg_t *(*get_peer_cfg_by_name)(local_backend_t *this, char *name);
65
66 /**
67 * @brief Create an iterator over all peer configs.
68 *
69 * @param this calling object
70 * @return iterator over peer configs
71 */
72 iterator_t* (*create_peer_cfg_iterator)(local_backend_t *this);
73
74 /**
75 * @brief Destroy a local backend.
76 *
77 * @param this calling object
78 */
79 void (*destroy)(local_backend_t *this);
80 };
81
82 /**
83 * @brief Creates a local_backend_t instance.
84 *
85 * @return local_backend instance.
86 *
87 * @ingroup config
88 */
89 local_backend_t *local_backend_create(void);
90
91 #endif /* LOCAL_BACKEND_H_ */