aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa/child_sa.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-03-13 11:38:02 +0100
committerMartin Willi <martin@revosec.ch>2013-03-14 14:20:54 +0100
commitd954a2081b565a97670f9563cef9acb7ad271e0c (patch)
treef1b5d69c4e1bac42de0101c0af95645dd2b43832 /src/libcharon/sa/child_sa.c
parent6b35ab84da3be4fc8da77da96fbdcd391c9b96db (diff)
downloadstrongswan-d954a2081b565a97670f9563cef9acb7ad271e0c.tar.bz2
strongswan-d954a2081b565a97670f9563cef9acb7ad271e0c.tar.xz
child_sa_t.get_usestats() can additionally return the number of processed packets
Diffstat (limited to 'src/libcharon/sa/child_sa.c')
-rw-r--r--src/libcharon/sa/child_sa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcharon/sa/child_sa.c b/src/libcharon/sa/child_sa.c
index 30ec00175..463ad2e22 100644
--- a/src/libcharon/sa/child_sa.c
+++ b/src/libcharon/sa/child_sa.c
@@ -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,