eda4c4ddbcbca6688816b75a3c0e3e7d245803b6
[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 * $Id$
16 */
17
18 /**
19 * @defgroup ha_sync_dispatcher ha_sync_dispatcher
20 * @{ @ingroup ha-sync
21 */
22
23 #ifndef HA_SYNC_DISPATCHER_H_
24 #define HA_SYNC_DISPATCHER_H_
25
26 #include "ha_sync_socket.h"
27 #include "ha_sync_cache.h"
28
29 typedef struct ha_sync_dispatcher_t ha_sync_dispatcher_t;
30
31 /**
32 * The dispatcher pulls sync message in a thread an processes them.
33 */
34 struct ha_sync_dispatcher_t {
35
36 /**
37 * Destroy a ha_sync_dispatcher_t.
38 */
39 void (*destroy)(ha_sync_dispatcher_t *this);
40 };
41
42 /**
43 * Create a ha_sync_dispatcher instance pulling from socket.
44 *
45 * @param socket socket to pull messages from
46 * @param cache cache to push synced SAs to
47 * @return dispatcher object
48 */
49 ha_sync_dispatcher_t *ha_sync_dispatcher_create(ha_sync_socket_t *socket,
50 ha_sync_cache_t *cache);
51
52 #endif /* HA_SYNC_DISPATCHER_ @}*/