summaryrefslogtreecommitdiff
path: root/accel-pppd/cli/show_sessions.c
diff options
context:
space:
mode:
authorDmitriy Eshenko <dmitriy.eshenko@accel-ppp.org>2023-07-01 09:57:36 +0300
committerGitHub <noreply@github.com>2023-07-01 09:57:36 +0300
commit7b7b6dabfd83eafc62555e0edc6147ebca270ac4 (patch)
treec257eb5211f15ba8d54c5d7a207099cadc1559ad /accel-pppd/cli/show_sessions.c
parent981f2399a8f61256f866a87f50c3b4a8aa77847c (diff)
parenta9e9f3ea0d7d4c48ba402d885372c978d5c75aab (diff)
downloadaccel-ppp-7b7b6dabfd83eafc62555e0edc6147ebca270ac4.tar.gz
accel-ppp-7b7b6dabfd83eafc62555e0edc6147ebca270ac4.zip
Merge pull request #95 from DmitriyEshenko/show-sessions-impr
CLI: PPPoE: Add possibility to display inbound interface and service-…
Diffstat (limited to 'accel-pppd/cli/show_sessions.c')
-rw-r--r--accel-pppd/cli/show_sessions.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c
index b814e824..22f5318a 100644
--- a/accel-pppd/cli/show_sessions.c
+++ b/accel-pppd/cli/show_sessions.c
@@ -629,6 +629,18 @@ static void print_tx_pkts(struct ap_session *ses, char *buf)
sprintf(buf, "%llu", stats.tx_packets);
}
+static void print_inbound_if(struct ap_session *ses, char *buf)
+{
+ if (ses->ctrl->ifname)
+ snprintf(buf, CELL_SIZE, "%s", ses->ctrl->ifname);
+}
+
+static void print_service_name(struct ap_session *ses, char *buf)
+{
+ if (ses->ctrl->service_name)
+ snprintf(buf, CELL_SIZE, "%s", ses->ctrl->service_name);
+}
+
static void load_config(void *data)
{
const char *opt = NULL;
@@ -663,7 +675,7 @@ static void init(void)
cli_show_ses_register("ip", "IP address", print_ip);
cli_show_ses_register("ip6", "IPv6 address", print_ip6);
cli_show_ses_register("ip6-dp", "IPv6 delegated prefix", print_ip6_dp);
- cli_show_ses_register("type", "VPN type", print_type);
+ cli_show_ses_register("type", "connection type", print_type);
cli_show_ses_register("state", "state of session", print_state);
cli_show_ses_register("uptime", "uptime (human readable)", print_uptime);
cli_show_ses_register("uptime-raw", "uptime (in seconds)", print_uptime_raw);
@@ -677,6 +689,8 @@ static void init(void)
cli_show_ses_register("tx-bytes-raw", "transmitted bytes", print_tx_bytes_raw);
cli_show_ses_register("rx-pkts", "received packets", print_rx_pkts);
cli_show_ses_register("tx-pkts", "transmitted packets", print_tx_pkts);
+ cli_show_ses_register("inbound-if", "inbound interface", print_inbound_if);
+ cli_show_ses_register("service-name", "PPPoE service name", print_service_name);
triton_event_register_handler(EV_CONFIG_RELOAD, load_config);
}