]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/charon/plugins/ha/ha_socket.h
Try to send HA sync messages synchronously
[thirdparty/strongswan.git] / src / charon / plugins / ha / ha_socket.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_socket ha_socket
18 * @{ @ingroup ha
19 */
20
21 #ifndef HA_SOCKET_H_
22 #define HA_SOCKET_H_
23
24 #include "ha_message.h"
25
26 #include <sa/ike_sa.h>
27
28 typedef struct ha_socket_t ha_socket_t;
29
30 /**
31 * Socket to send/received SA synchronization data
32 */
33 struct ha_socket_t {
34
35 /**
36 * Push synchronization information to the responsible node.
37 *
38 * @param message message to send, gets destroyed by push()
39 */
40 void (*push)(ha_socket_t *this, ha_message_t *message);
41
42 /**
43 * Pull synchronization information from a peer we are responsible.
44 *
45 * @return received message
46 */
47 ha_message_t *(*pull)(ha_socket_t *this);
48
49 /**
50 * Destroy a ha_socket_t.
51 */
52 void (*destroy)(ha_socket_t *this);
53 };
54
55 /**
56 * Create a ha_socket instance.
57 */
58 ha_socket_t *ha_socket_create(char *local, char *remote);
59
60 #endif /* HA_SOCKET_ @}*/