62908cf55e9a29095827b3125e2777ff3725e05b
[strongswan.git] / src / charon / plugins / ha_sync / ha_sync_segments.h
1 /*
2 * Copyright (C) 2008 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 * $Id$
16 */
17
18 /**
19 * @defgroup ha_sync_segments ha_sync_segments
20 * @{ @ingroup ha_sync
21 */
22
23 #ifndef HA_SYNC_SEGMENTS_H_
24 #define HA_SYNC_SEGMENTS_H_
25
26 #include <daemon.h>
27
28 typedef struct ha_sync_segments_t ha_sync_segments_t;
29
30 /**
31 * Locally segmentsd HA state synced from other nodes.
32 */
33 struct ha_sync_segments_t {
34
35 /**
36 * Activate a set of IKE_SAs identified by a segments.
37 *
38 * Activating means do a takeover of SAs as the responsible node has failed.
39 * This involves moving all SAs to the daemons IKE_SA manager and handle
40 * them actively now.
41 *
42 * @param segments numerical segments to takeover
43 */
44 void (*activate)(ha_sync_segments_t *this, u_int segments);
45
46 /**
47 * Deactivate a set of IKE_SAs identified by a segments.
48 *
49 * @param segments numerical segments to takeover
50 */
51 void (*deactivate)(ha_sync_segments_t *this, u_int segments);
52
53 /**
54 * Destroy a ha_sync_segments_t.
55 */
56 void (*destroy)(ha_sync_segments_t *this);
57 };
58
59 /**
60 * Create a ha_sync_segments instance.
61 */
62 ha_sync_segments_t *ha_sync_segments_create();
63
64 #endif /* HA_SYNC_SEGMENTS_ @}*/