Propagate segment manipulation to cluster node
[strongswan.git] / src / charon / plugins / ha_sync / ha_sync_dispatcher.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
16 /**
17 * @defgroup ha_sync_dispatcher ha_sync_dispatcher
18 * @{ @ingroup ha-sync
19 */
20
21 #ifndef HA_SYNC_DISPATCHER_H_
22 #define HA_SYNC_DISPATCHER_H_
23
24 #include "ha_sync_socket.h"
25 #include "ha_sync_segments.h"
26
27 typedef struct ha_sync_dispatcher_t ha_sync_dispatcher_t;
28
29 /**
30 * The dispatcher pulls sync message in a thread an processes them.
31 */
32 struct ha_sync_dispatcher_t {
33
34 /**
35 * Destroy a ha_sync_dispatcher_t.
36 */
37 void (*destroy)(ha_sync_dispatcher_t *this);
38 };
39
40 /**
41 * Create a ha_sync_dispatcher instance pulling from socket.
42 *
43 * @param socket socket to pull messages from
44 * @param segments segments to control based on received messages
45 * @return dispatcher object
46 */
47 ha_sync_dispatcher_t *ha_sync_dispatcher_create(ha_sync_socket_t *socket,
48 ha_sync_segments_t *segments);
49
50 #endif /* HA_SYNC_DISPATCHER_ @}*/