2 * Copyright (C) 2008 Martin Willi
4 * Copyright (C) secunet Security Networks AG
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>.
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
17 #include "load_tester_ipsec.h"
21 typedef struct private_load_tester_ipsec_t private_load_tester_ipsec_t
;
24 * Private variables and functions of kernel_pfkey class.
26 struct private_load_tester_ipsec_t
{
30 load_tester_ipsec_t
public;
38 METHOD(kernel_ipsec_t
, get_spi
, status_t
,
39 private_load_tester_ipsec_t
*this, host_t
*src
, host_t
*dst
,
40 uint8_t protocol
, uint32_t *spi
)
42 *spi
= (uint32_t)ref_get(&this->spi
);
46 METHOD(kernel_ipsec_t
, get_cpi
, status_t
,
47 private_load_tester_ipsec_t
*this, host_t
*src
, host_t
*dst
,
53 METHOD(kernel_ipsec_t
, add_sa
, status_t
,
54 private_load_tester_ipsec_t
*this, kernel_ipsec_sa_id_t
*id
,
55 kernel_ipsec_add_sa_t
*data
)
60 METHOD(kernel_ipsec_t
, update_sa
, status_t
,
61 private_load_tester_ipsec_t
*this, kernel_ipsec_sa_id_t
*id
,
62 kernel_ipsec_update_sa_t
*data
)
67 METHOD(kernel_ipsec_t
, query_sa
, status_t
,
68 private_load_tester_ipsec_t
*this, kernel_ipsec_sa_id_t
*id
,
69 kernel_ipsec_query_sa_t
*data
, uint64_t *bytes
, uint64_t *packets
,
75 METHOD(kernel_ipsec_t
, del_sa
, status_t
,
76 private_load_tester_ipsec_t
*this, kernel_ipsec_sa_id_t
*id
,
77 kernel_ipsec_del_sa_t
*data
)
82 METHOD(kernel_ipsec_t
, add_policy
, status_t
,
83 private_load_tester_ipsec_t
*this, kernel_ipsec_policy_id_t
*id
,
84 kernel_ipsec_manage_policy_t
*data
)
89 METHOD(kernel_ipsec_t
, query_policy
, status_t
,
90 private_load_tester_ipsec_t
*this, kernel_ipsec_policy_id_t
*id
,
91 kernel_ipsec_query_policy_t
*data
, time_t *use_time
)
97 METHOD(kernel_ipsec_t
, del_policy
, status_t
,
98 private_load_tester_ipsec_t
*this, kernel_ipsec_policy_id_t
*id
,
99 kernel_ipsec_manage_policy_t
*data
)
104 METHOD(kernel_ipsec_t
, destroy
, void,
105 private_load_tester_ipsec_t
*this)
111 * Described in header.
113 load_tester_ipsec_t
*load_tester_ipsec_create()
115 private_load_tester_ipsec_t
*this;
123 .update_sa
= _update_sa
,
124 .query_sa
= _query_sa
,
126 .flush_sas
= (void*)return_failed
,
127 .add_policy
= _add_policy
,
128 .query_policy
= _query_policy
,
129 .del_policy
= _del_policy
,
130 .flush_policies
= (void*)return_failed
,
131 .bypass_socket
= (void*)return_true
,
132 .enable_udp_decap
= (void*)return_true
,
139 return &this->public;