aboutsummaryrefslogtreecommitdiff
path: root/multi.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-10-24 09:21:40 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-10-24 09:21:40 +0000
commit5f435d64d7c0694a56a64dc7a79d4828fcf8154c (patch)
tree73f96b3705c2134d9cea87305f83e3571c81da4a /multi.c
parentAdded optional files SAMPCONF_CONF2 (second sample configuration (diff)
downloadopenvpn-5f435d64d7c0694a56a64dc7a79d4828fcf8154c.tar.xz
Extended Management Interface "bytecount" command
to work when OpenVPN is running as a server. Documented Management Interface "bytecount" command in management/management-notes.txt. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3452 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to '')
-rw-r--r--multi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/multi.c b/multi.c
index e19101f..4898b44 100644
--- a/multi.c
+++ b/multi.c
@@ -437,6 +437,13 @@ multi_del_iroutes (struct multi_context *m,
}
static void
+setenv_stats (struct context *c)
+{
+ setenv_counter (c->c2.es, "bytes_received", c->c2.link_read_bytes);
+ setenv_counter (c->c2.es, "bytes_sent", c->c2.link_write_bytes);
+}
+
+static void
multi_client_disconnect_setenv (struct multi_context *m,
struct multi_instance *mi)
{
@@ -444,8 +451,7 @@ multi_client_disconnect_setenv (struct multi_context *m,
setenv_trusted (mi->context.c2.es, get_link_socket_info (&mi->context));
/* setenv stats */
- setenv_counter (mi->context.c2.es, "bytes_received", mi->context.c2.link_read_bytes);
- setenv_counter (mi->context.c2.es, "bytes_sent", mi->context.c2.link_write_bytes);
+ setenv_stats (&mi->context);
/* setenv connection duration */
{
@@ -2583,6 +2589,7 @@ init_management_callback_multi (struct multi_context *m)
struct management_callback cb;
CLEAR (cb);
cb.arg = m;
+ cb.flags = MCF_SERVER;
cb.status = management_callback_status;
cb.show_net = management_show_net_callback;
cb.kill_by_cn = management_callback_kill_by_cn;