]> 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 11:28:17 +0000 (12:28 +0100)
commita9991b3eb6644785421398bff8cb3a728d131713
tree2356fcb36c9425c08072dd7fad8d6eabdc8e1312
parent2f9c56e2cb0ce0f8d7a2a30f89831d1ddc0f2bbb
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>
src/openvpn/forward.c
src/openvpn/manage.c
src/openvpn/manage.h