Export TUN device statistics from the worker process.

When a worker process terminates in authenticated state, then
export statistics from the tun device (currently bytes_in and
bytes_out). These statistics are sent to main process using an
informational message just prior to process exit. The statistics
are also exported to the disconnect script using the STATS_BYTES_IN
and STATS_BYTES_OUT environment variables.
This commit is contained in:
Nikos Mavrogiannopoulos
2014-04-28 17:32:51 +02:00
parent 2c213d4e52
commit 2a0cc77c2e
9 changed files with 76 additions and 7 deletions
+4
View File
@@ -202,6 +202,10 @@ typedef struct worker_st {
unsigned cert_auth_ok;
int tun_fd;
/* tun device stats */
uint64_t tun_bytes_in;
uint64_t tun_bytes_out;
/* information on the tun device addresses and network */
struct vpn_st vinfo;