Return to ha_cache.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libcharon / plugins / ha |
1.1 misho 1: /* 2: * Copyright (C) 2010 Martin Willi 3: * Copyright (C) 2010 revosec AG 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_cache ha_cache 18: * @{ @ingroup ha 19: */ 20: 21: #ifndef HA_CACHE_H_ 22: #define HA_CACHE_H_ 23: 24: typedef struct ha_cache_t ha_cache_t; 25: 26: #include "ha_message.h" 27: #include "ha_kernel.h" 28: #include "ha_socket.h" 29: 30: #include <collections/enumerator.h> 31: 32: #include <sa/ike_sa.h> 33: 34: /** 35: * HA message caching facility, allows reintegration of new nodes. 36: */ 37: struct ha_cache_t { 38: 39: /** 40: * Cache an IKE specific message. 41: * 42: * @param ike_sa associated IKE_SA 43: * @param message message to cache 44: */ 45: void (*cache)(ha_cache_t *this, ike_sa_t *ike_sa, ha_message_t *message); 46: 47: /** 48: * Delete a cache entry for an IKE_SA. 49: * 50: * @param ike_sa cache entry to delete 51: */ 52: void (*delete)(ha_cache_t *this, ike_sa_t *ike_sa); 53: 54: /** 55: * Resync a segment to the node using the cached messages. 56: * 57: * @param segment segment to resync 58: */ 59: void (*resync)(ha_cache_t *this, u_int segment); 60: 61: /** 62: * Destroy a ha_cache_t. 63: */ 64: void (*destroy)(ha_cache_t *this); 65: }; 66: 67: /** 68: * Create a ha_cache instance. 69: * 70: * @param kernel kernel helper 71: * @param socket socket to send resync messages 72: * @param tunnel HA tunnel 73: * @param resync request a resync during startup? 74: * @param count total number of segments 75: */ 76: ha_cache_t *ha_cache_create(ha_kernel_t *kernel, ha_socket_t *socket, 77: ha_tunnel_t *tunnel, bool resync, u_int count); 78: 79: #endif /** HA_CACHE_H_ @}*/