summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2017-01-26 00:24:34 +0000
committerjsorg71 <jay.sorg@gmail.com>2017-02-02 21:24:50 -0800
commit99e4e4520a2a3854db8729e1b7c4ca5217d0987c (patch)
treed85325bddc38c2b8200c8cc5be10f23f47941693 /sesman
parentea6882fd4c3842c531bc8e92fd33355a64f2615c (diff)
downloadxrdp-proprietary-99e4e4520a2a3854db8729e1b7c4ca5217d0987c.tar.gz
xrdp-proprietary-99e4e4520a2a3854db8729e1b7c4ca5217d0987c.zip
xrdp-sesadmin: show sessions in human readable format
Diffstat (limited to 'sesman')
-rw-r--r--sesman/tools/sesadmin.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sesman/tools/sesadmin.c b/sesman/tools/sesadmin.c
index 272c0e95..20458461 100644
--- a/sesman/tools/sesadmin.c
+++ b/sesman/tools/sesadmin.c
@@ -187,6 +187,20 @@ void cmndHelp(void)
fprintf(stderr, " kill:<sid>\n");
}
+static void
+print_session(const struct SCP_DISCONNECTED_SESSION *s)
+{
+ printf("Session ID: %d\n", s->SID);
+ printf("\tSession type: %d\n", s->type);
+ printf("\tScreen size: %dx%d, color depth %d\n",
+ s->width, s->height, s->bpp);
+ printf("\tIdle time: %d day(s) %d hour(s) %d minute(s)\n",
+ s->idle_days, s->idle_hours, s->idle_minutes);
+ printf("\tConnected: %04d/%02d/%02d %02d:%02d\n",
+ s->conn_year, s->conn_month, s->conn_day, s->conn_hour,
+ s->conn_minute);
+}
+
void cmndList(struct SCP_CONNECTION *c)
{
struct SCP_DISCONNECTED_SESSION *dsl;
@@ -206,13 +220,7 @@ void cmndList(struct SCP_CONNECTION *c)
{
for (idx = 0; idx < scnt; idx++)
{
- struct SCP_DISCONNECTED_SESSION *s = &dsl[idx];
-
- printf("%d\t%d\t%dx%dx%d\t%d-%d-%d\t%04d/%02d/%02d@%02d:%02d\n",
- s->SID, s->type, s->width, s->height, s->bpp,
- s->idle_days, s->idle_hours, s->idle_minutes,
- s->conn_year, s->conn_month, s->conn_day, s->conn_hour,
- s->conn_minute);
+ print_session(&dsl[idx]);
}
}
else