display transmitted bytes per SA
This commit is contained in:
@@ -103,6 +103,19 @@ static status_t update_sa(private_kernel_interface_t *this, u_int32_t spi,
|
||||
new_src, new_dst, encap, new_encap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of kernel_interface_t.query_sa
|
||||
*/
|
||||
static status_t query_sa(private_kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, protocol_id_t protocol, u_int64_t *bytes)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
{
|
||||
return NOT_SUPPORTED;
|
||||
}
|
||||
return this->ipsec->query_sa(this->ipsec, src, dst, spi, protocol, bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of kernel_interface_t.del_sa
|
||||
*/
|
||||
@@ -387,6 +400,7 @@ kernel_interface_t *kernel_interface_create()
|
||||
this->public.get_cpi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,u_int16_t*))get_cpi;
|
||||
this->public.add_sa = (status_t(*)(kernel_interface_t *,host_t*,host_t*,u_int32_t,protocol_id_t,u_int32_t,u_int64_t,u_int64_t,u_int16_t,chunk_t,u_int16_t,chunk_t,ipsec_mode_t,u_int16_t,u_int16_t,bool,bool))add_sa;
|
||||
this->public.update_sa = (status_t(*)(kernel_interface_t*,u_int32_t,protocol_id_t,u_int16_t,host_t*,host_t*,host_t*,host_t*,bool,bool))update_sa;
|
||||
this->public.query_sa = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,protocol_id_t,u_int64_t*))query_sa;
|
||||
this->public.del_sa = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,protocol_id_t,u_int16_t))del_sa;
|
||||
this->public.add_policy = (status_t(*)(kernel_interface_t*,host_t*,host_t*,traffic_selector_t*,traffic_selector_t*,policy_dir_t,u_int32_t,protocol_id_t,u_int32_t,ipsec_mode_t,u_int16_t,u_int16_t,bool))add_policy;
|
||||
this->public.query_policy = (status_t(*)(kernel_interface_t*,traffic_selector_t*,traffic_selector_t*,policy_dir_t,u_int32_t*))query_policy;
|
||||
|
||||
@@ -140,6 +140,19 @@ struct kernel_interface_t {
|
||||
host_t *new_src, host_t *new_dst,
|
||||
bool encap, bool new_encap);
|
||||
|
||||
/**
|
||||
* Query the number of bytes processed by an SA from the SAD.
|
||||
*
|
||||
* @param src source address for this SA
|
||||
* @param dst destination address for this SA
|
||||
* @param spi SPI allocated by us or remote peer
|
||||
* @param protocol protocol for this SA (ESP/AH)
|
||||
* @param[out] bytes the number of bytes processed by SA
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*query_sa) (kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, protocol_id_t protocol, u_int64_t *bytes);
|
||||
|
||||
/**
|
||||
* Delete a previously installed SA from the SAD.
|
||||
*
|
||||
|
||||
@@ -170,6 +170,19 @@ struct kernel_ipsec_t {
|
||||
host_t *new_src, host_t *new_dst,
|
||||
bool encap, bool new_encap);
|
||||
|
||||
/**
|
||||
* Query the number of bytes processed by an SA from the SAD.
|
||||
*
|
||||
* @param src source address for this SA
|
||||
* @param dst destination address for this SA
|
||||
* @param spi SPI allocated by us or remote peer
|
||||
* @param protocol protocol for this SA (ESP/AH)
|
||||
* @param[out] bytes the number of bytes processed by SA
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*query_sa) (kernel_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, protocol_id_t protocol, u_int64_t *bytes);
|
||||
|
||||
/**
|
||||
* Delete a previusly installed SA from the SAD.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user