diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2018-10-22 12:25:06 +0200 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2018-10-23 09:44:47 +0300 |
commit | 29d2895e92e91652c7940bb273f73ed44e09b0d8 (patch) | |
tree | 6cdbddb9c5d17e515c07e353accf2d74c46e6a52 /accel-pppd/cli | |
parent | 7103ae4d8b24b171f5321894a9bb045d018f0f40 (diff) | |
download | accel-ppp-xebd-29d2895e92e91652c7940bb273f73ed44e09b0d8.tar.gz accel-ppp-xebd-29d2895e92e91652c7940bb273f73ed44e09b0d8.zip |
cli: add network namespace column in "show sessions"
Define a new column, called "netns", that prints the network namespace
in which sessions are set.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r-- | accel-pppd/cli/show_sessions.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c index c725e05..0ea3c94 100644 --- a/accel-pppd/cli/show_sessions.c +++ b/accel-pppd/cli/show_sessions.c @@ -379,6 +379,11 @@ early_out: goto out; } +static void print_netns(struct ap_session *ses, char *buf) +{ + snprintf(buf, CELL_SIZE, "%s", ses->net->name); +} + static void print_ifname(struct ap_session *ses, char *buf) { snprintf(buf, CELL_SIZE, "%s", ses->ifname); @@ -633,6 +638,7 @@ static void init(void) cli_register_simple_cmd2(show_ses_exec, show_ses_help, 2, "show", "sessions"); + cli_show_ses_register("netns", "network namespace name", print_netns); cli_show_ses_register("ifname", "interface name", print_ifname); cli_show_ses_register("username", "user name", print_username); cli_show_ses_register("ip", "IP address", print_ip); |