Moved data structures to new collections subfolder
[strongswan.git] / src / libcharon / sa / shunt_manager.h
1 /*
2 * Copyright (C) 2011 Andreas Steffen
3 * HSR 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
16 /**
17 * @defgroup shunt_manager shunt_manager
18 * @{ @ingroup sa
19 */
20
21 #ifndef SHUNT_MANAGER_H_
22 #define SHUNT_MANAGER_H_
23
24 #include <library.h>
25 #include <collections/enumerator.h>
26 #include <config/child_cfg.h>
27
28 typedef struct shunt_manager_t shunt_manager_t;
29
30 /**
31 * Manage PASS and DROP shunt policy excepting traffic from IPsec SAs.
32 */
33 struct shunt_manager_t {
34
35 /**
36 * Install a policy as a shunt.
37 *
38 * @param child child configuration to install as a shunt
39 * @return TRUE if installed successfully
40 */
41 bool (*install)(shunt_manager_t *this, child_cfg_t *child);
42
43 /**
44 * Uninstall a shunt policy.
45 *
46 * @param name name of child configuration to uninstall as a shunt
47 * @return TRUE if uninstalled successfully
48 */
49 bool (*uninstall)(shunt_manager_t *this, char *name);
50
51 /**
52 * Create an enumerator over all installed shunts.
53 *
54 * @return enumerator over (child_sa_t)
55 */
56 enumerator_t* (*create_enumerator)(shunt_manager_t *this);
57
58 /**
59 * Destroy a shunt_manager_t.
60 */
61 void (*destroy)(shunt_manager_t *this);
62 };
63
64 /**
65 * Create a shunt_manager instance.
66 */
67 shunt_manager_t *shunt_manager_create();
68
69 #endif /** SHUNT_MANAGER_H_ @}*/