Annotation of embedaddon/strongswan/src/libcharon/sa/shunt_manager.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2015-2017 Tobias Brunner
3: * Copyright (C) 2011 Andreas Steffen
4: * HSR Hochschule fuer Technik Rapperswil
5: *
6: * This program is free software; you can redistribute it and/or modify it
7: * under the terms of the GNU General Public License as published by the
8: * Free Software Foundation; either version 2 of the License, or (at your
9: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * for more details.
15: */
16:
17: /**
18: * @defgroup shunt_manager shunt_manager
19: * @{ @ingroup sa
20: */
21:
22: #ifndef SHUNT_MANAGER_H_
23: #define SHUNT_MANAGER_H_
24:
25: #include <library.h>
26: #include <collections/enumerator.h>
27: #include <config/child_cfg.h>
28:
29: typedef struct shunt_manager_t shunt_manager_t;
30:
31: /**
32: * Manage PASS and DROP shunt policy excepting traffic from IPsec SAs.
33: */
34: struct shunt_manager_t {
35:
36: /**
37: * Install a policy as a shunt.
38: *
39: * @param ns namespace (e.g. name of a connection or plugin), cloned
40: * @param child child configuration to install as a shunt
41: * @return TRUE if installed successfully
42: */
43: bool (*install)(shunt_manager_t *this, char *ns, child_cfg_t *child);
44:
45: /**
46: * Uninstall a shunt policy.
47: *
48: * If no namespace is given the first matching child configuration is
49: * removed.
50: *
51: * @param ns namespace (same as given during installation) or NULL
52: * @param name name of child configuration to uninstall as a shunt
53: * @return TRUE if uninstalled successfully
54: */
55: bool (*uninstall)(shunt_manager_t *this, char *ns, char *name);
56:
57: /**
58: * Create an enumerator over all installed shunts.
59: *
60: * @return enumerator over (char*, child_cfg_t*)
61: */
62: enumerator_t* (*create_enumerator)(shunt_manager_t *this);
63:
64: /**
65: * Clear any installed shunt.
66: */
67: void (*flush)(shunt_manager_t *this);
68:
69: /**
70: * Destroy a shunt_manager_t.
71: */
72: void (*destroy)(shunt_manager_t *this);
73: };
74:
75: /**
76: * Create a shunt_manager instance.
77: */
78: shunt_manager_t *shunt_manager_create();
79:
80: #endif /** SHUNT_MANAGER_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>