summaryrefslogtreecommitdiff
path: root/accel-pppd/cli
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-05-14 23:06:11 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-05-14 23:06:11 +0400
commit6efad618371915bf0b402f26117a02ad53aaeb20 (patch)
treebb42d0b5cf81cfc2622ef72dbe33b60c154e5190 /accel-pppd/cli
parent64c36cc7dc0beac13c715bb5dedc697861c1badf (diff)
downloadaccel-ppp-6efad618371915bf0b402f26117a02ad53aaeb20.tar.gz
accel-ppp-6efad618371915bf0b402f26117a02ad53aaeb20.zip
cli: add 'comp' field to 'show sessions' to indicate compression/encryption method
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r--accel-pppd/cli/show_sessions.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c
index 4caded1..c0fec58 100644
--- a/accel-pppd/cli/show_sessions.c
+++ b/accel-pppd/cli/show_sessions.c
@@ -15,7 +15,7 @@
#include "memdebug.h"
#define CELL_SIZE 128
-#define DEF_COLUMNS "ifname,username,calling-sid,ip,rate-limit,type,state,uptime"
+#define DEF_COLUMNS "ifname,username,calling-sid,ip,rate-limit,type,comp,state,uptime"
struct column_t
{
@@ -450,6 +450,11 @@ static void print_sid(const struct ppp_t *ppp, char *buf)
snprintf(buf, CELL_SIZE, "%s", ppp->sessionid);
}
+static void print_comp(const struct ppp_t *ppp, char *buf)
+{
+ snprintf(buf, CELL_SIZE, "%s", ppp->comp ? ppp->comp : "");
+}
+
static void init(void)
{
cli_register_simple_cmd2(show_ses_exec, show_ses_help, 2, "show", "sessions");
@@ -463,6 +468,7 @@ static void init(void)
cli_show_ses_register("calling-sid", "calling station id", print_calling_sid);
cli_show_ses_register("called-sid", "called station id", print_called_sid);
cli_show_ses_register("sid", "session id", print_sid);
+ cli_show_ses_register("comp", "compression/ecnryption method", print_comp);
}
DEFINE_INIT(12, init);