aboutsummaryrefslogtreecommitdiff
path: root/manage.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-12-18 07:57:19 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-12-18 07:57:19 +0000
commit4fb4ce12d90abf43f96af67dd308124742b59961 (patch)
tree00e619d26e38e41cb8f48d93dced3bd7061c6c2e /manage.c
parentAdded MultiFileExtract capability to Windows Installer. (diff)
downloadopenvpn-4fb4ce12d90abf43f96af67dd308124742b59961.tar.xz
Added "nclients" command to management interface to
display the current number of authenticated clients connected to the server. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3717 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'manage.c')
-rw-r--r--manage.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/manage.c b/manage.c
index 4248787..7eff627 100644
--- a/manage.c
+++ b/manage.c
@@ -916,6 +916,20 @@ man_client_kill (struct management *man, const char *cid_str)
}
}
+static void
+man_client_n_clients (struct management *man)
+{
+ if (man->persist.callback.n_clients)
+ {
+ const int nclients = (*man->persist.callback.n_clients) (man->persist.callback.arg);
+ msg (M_CLIENT, "SUCCESS: nclients=%d", nclients);
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The nclients command is not supported by the current daemon mode");
+ }
+}
+
#ifdef MANAGEMENT_PF
static void
@@ -981,6 +995,10 @@ man_dispatch_command (struct management *man, struct status_output *so, const ch
{
msg (M_CLIENT, "SUCCESS: pid=%d", openvpn_getpid ());
}
+ else if (streq (p[0], "nclients"))
+ {
+ man_client_n_clients (man);
+ }
else if (streq (p[0], "signal"))
{
if (man_need (man, p, 1, 0))