Implement Esa Event Service (EES)
[strongswan.git] / src / charon-tkm / src / ees / ees_callbacks.c
1 /*
2 * Copyright (C) 2012 Reto Buerki
3 * Copyright (C) 2012 Adrian-Ken Rueegsegger
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 #include <hydra.h>
18 #include <utils/debug.h>
19 #include <tkm/constants.h>
20 #include <tkm/types.h>
21
22 #include "ees_callbacks.h"
23
24 void charon_esa_acquire(result_type *res, const sp_id_type sp_id)
25 {
26 DBG1(DBG_KNL, "ees: acquire received for reqid {%d}", sp_id);
27 hydra->kernel_interface->acquire(hydra->kernel_interface, sp_id, NULL,
28 NULL);
29 *res = TKM_OK;
30 }
31
32 void charon_esa_expire(result_type *res, const sp_id_type sp_id,
33 const esp_spi_type spi_rem, const protocol_type protocol,
34 const expiry_flag_type hard)
35 {
36 DBG1(DBG_KNL, "ees: expire received for reqid {%d}", sp_id);
37 hydra->kernel_interface->expire(hydra->kernel_interface, sp_id, protocol,
38 spi_rem, hard != 0);
39 *res = TKM_OK;
40 }