summaryrefslogtreecommitdiff
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
parent64c36cc7dc0beac13c715bb5dedc697861c1badf (diff)
downloadaccel-ppp-6efad618371915bf0b402f26117a02ad53aaeb20.tar.gz
accel-ppp-6efad618371915bf0b402f26117a02ad53aaeb20.zip
cli: add 'comp' field to 'show sessions' to indicate compression/encryption method
-rw-r--r--accel-pppd/cli/show_sessions.c8
-rw-r--r--accel-pppd/ppp/ccp_mppe.c4
-rw-r--r--accel-pppd/ppp/ppp.h1
3 files changed, 11 insertions, 2 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);
diff --git a/accel-pppd/ppp/ccp_mppe.c b/accel-pppd/ppp/ccp_mppe.c
index 90f9d83..388e2f6 100644
--- a/accel-pppd/ppp/ccp_mppe.c
+++ b/accel-pppd/ppp/ccp_mppe.c
@@ -214,7 +214,9 @@ static int mppe_recv_conf_req(struct ppp_ccp_t *ccp, struct ccp_option_t *opt, u
}
log_ppp_debug(" (mppe enabled)");
- }
+ ccp->ppp->comp = "mppe";
+ } else
+ ccp->ppp->comp = NULL;
return CCP_OPT_ACK;
}
diff --git a/accel-pppd/ppp/ppp.h b/accel-pppd/ppp/ppp.h
index 18cb5c2..f831242 100644
--- a/accel-pppd/ppp/ppp.h
+++ b/accel-pppd/ppp/ppp.h
@@ -114,6 +114,7 @@ struct ppp_t
struct ipv6db_item_t *ipv6;
char *ipv4_pool_name;
char *ipv6_pool_name;
+ const char *comp;
struct ppp_ctrl_t *ctrl;