Do not install iptables rules, they should stay active after shutdown
[strongswan.git] / src / charon / plugins / ha / ha_kernel.h
1 /*
2 * Copyright (C) 2009 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
16 /**
17 * @defgroup ha_kernel ha_kernel
18 * @{ @ingroup ha
19 */
20
21 #ifndef HA_KERNEL_H_
22 #define HA_KERNEL_H_
23
24 typedef struct ha_kernel_t ha_kernel_t;
25
26 #include "ha_segments.h"
27
28 /**
29 * HA segment kernel configuration interface.
30 */
31 struct ha_kernel_t {
32
33 /**
34 * Check if a host is in a segment.
35 *
36 * @param host host to check
37 * @param segment segment
38 * @return TRUE if host belongs to segment
39 */
40 bool (*in_segment)(ha_kernel_t *this, host_t *host, u_int segment);
41
42 /**
43 * Activate a segment at kernel level for all cluster addresses.
44 *
45 * @param segment segment to activate
46 */
47 void (*activate)(ha_kernel_t *this, u_int segment);
48
49 /**
50 * Deactivate a segment at kernel level for all cluster addresses.
51 *
52 * @param segment segment to deactivate
53 */
54 void (*deactivate)(ha_kernel_t *this, u_int segment);
55
56 /**
57 * Destroy a ha_kernel_t.
58 */
59 void (*destroy)(ha_kernel_t *this);
60 };
61
62 /**
63 * Create a ha_kernel instance.
64 *
65 * @param count total number of segments to use
66 * @param active bitmask of initially active segments
67 */
68 ha_kernel_t *ha_kernel_create(u_int count);
69
70 #endif /* HA_KERNEL_ @}*/