]> git.ipfire.org Git - thirdparty/openvpn.git/commit
management: add timer to output BYTECOUNT
authorLev Stipakov <lev@openvpn.net>
Wed, 14 Dec 2022 22:42:20 +0000 (00:42 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 15 Dec 2022 12:10:38 +0000 (13:10 +0100)
commit59a96c3ee05cdb842af0956de0a2ba3ffd993980
treea15964781558b97bb1a08aeb89cc9d6c8657bc72
parent0b18e23b67ac3c8e64ed44c8e907c53a15cf96d0
management: add timer to output BYTECOUNT

BYTECOUNT on management interface is used to display client stats,
for example by openvpn-gui. At the moment BYTECOUNT is sent if
there is a traffic. With DCO, userspace process doesn't see data
channel traffic, BYTECOUNT is not sent and therefore stats
are not updated.

Fix displaying DCO client stats by adding a timer, which is triggerd
every n seconds, where n is set by existing management command
bytecount <n>. Output stats, taking into account stats from DCO,
when timer is triggered.

While on it, simplify bytecount routines call chains - inlining
functions which are used only once.

DCO stats fetching is not yet implemented.

Stats for the server mode (BYTECOUNT_CLI) are unaffected
by this change - to output those in timer callback we would need to
enumerate all peers, and I am not sure we want to output stats
for all peers every <n> seconds.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20221214224220.307-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25707.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit a9991b3eb6644785421398bff8cb3a728d131713)
src/openvpn/forward.c
src/openvpn/manage.c
src/openvpn/manage.h