child_sa_t.get_usestats() can additionally return the number of processed packets

This commit is contained in:
Martin Willi
2013-03-14 14:20:54 +01:00
parent 6b35ab84da
commit d954a2081b
9 changed files with 20 additions and 16 deletions
+6 -1
View File
@@ -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,