child_sa_t.get_usestats() can additionally return the number of processed packets
This commit is contained in:
@@ -524,7 +524,8 @@ static void update_usetime(private_child_sa_t *this, bool inbound)
|
||||
}
|
||||
|
||||
METHOD(child_sa_t, get_usestats, void,
|
||||
private_child_sa_t *this, bool inbound, time_t *time, u_int64_t *bytes)
|
||||
private_child_sa_t *this, bool inbound,
|
||||
time_t *time, u_int64_t *bytes, u_int64_t *packets)
|
||||
{
|
||||
if (update_usebytes(this, inbound) != FAILED)
|
||||
{
|
||||
@@ -541,6 +542,10 @@ METHOD(child_sa_t, get_usestats, void,
|
||||
{
|
||||
*bytes = inbound ? this->my_usebytes : this->other_usebytes;
|
||||
}
|
||||
if (packets)
|
||||
{
|
||||
*packets = inbound ? this->my_usepackets : this->other_usepackets;
|
||||
}
|
||||
}
|
||||
|
||||
METHOD(child_sa_t, get_mark, mark_t,
|
||||
|
||||
Reference in New Issue
Block a user