diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-07-30 23:19:42 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-07-30 23:19:42 +0200 |
commit | 3f720dc7c34234886955ce31db7c08ac4a19ea89 (patch) | |
tree | 29b48861e1406d5dd8e061ed74506b3f84b7da90 /src/charon/plugins/stroke/stroke_list.c | |
parent | 2ad51539f60326a0478f9b279655c61abe1b196a (diff) | |
download | strongswan-3f720dc7.tar.bz2 strongswan-3f720dc7.tar.xz |
update usetime only if usebytes increase
Diffstat (limited to 'src/charon/plugins/stroke/stroke_list.c')
-rw-r--r-- | src/charon/plugins/stroke/stroke_list.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/charon/plugins/stroke/stroke_list.c b/src/charon/plugins/stroke/stroke_list.c index 591fd3cae..1a6b5e899 100644 --- a/src/charon/plugins/stroke/stroke_list.c +++ b/src/charon/plugins/stroke/stroke_list.c @@ -175,6 +175,8 @@ static void log_child_sa(FILE *out, child_sa_t *child_sa, bool all) if (all) { + bool change; + fprintf(out, "\n%12s{%d}: ", child_sa->get_name(child_sa), child_sa->get_reqid(child_sa)); @@ -207,22 +209,22 @@ static void log_child_sa(FILE *out, child_sa_t *child_sa, bool all) } } - bytes_in = child_sa->get_usebytes(child_sa, TRUE); + bytes_in = child_sa->get_usebytes(child_sa, TRUE, &change); fprintf(out, ", %lu bytes_i", bytes_in); if (bytes_in) { - use_in = child_sa->get_usetime(child_sa, TRUE); + use_in = child_sa->get_usetime(child_sa, TRUE, change); if (use_in) { fprintf(out, " (%ds ago)", now - use_in); } } - bytes_out = child_sa->get_usebytes(child_sa, FALSE); + bytes_out = child_sa->get_usebytes(child_sa, FALSE, &change); fprintf(out, ", %lu bytes_o", bytes_out); if (bytes_out) { - use_out = child_sa->get_usetime(child_sa, FALSE); + use_out = child_sa->get_usetime(child_sa, FALSE, change); if (use_out) { fprintf(out, " (%ds ago)", now - use_out); |