aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns2_vty.c
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2020-11-06 15:40:27 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2020-11-06 15:40:27 +0100
commited1fa018c3847f68d3bc54cc8ccb08815e5b6d6f (patch)
tree0d453b871d8e694e9d420a0e14a8b38de86cd03c /src/gb/gprs_ns2_vty.c
parent15c09a81e908d01a80ac0ac0fd4eed980067ae5e (diff)
ns2: Improve NSVC output
In show ns lots of info was printed many times. We can just use gprs_ns2_ll_str() to get the information about an NSVC so use that and ensure newlines. The NSVC are still printed twice - at least for the UDP bind: Once in dump_nse and once in dump_bind. Change-Id: I6f734d92ec1e17f339f7b32e449ffd614efa7319 Related: SYS#4998
Diffstat (limited to 'src/gb/gprs_ns2_vty.c')
-rw-r--r--src/gb/gprs_ns2_vty.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index a457361a..65fe88ee 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -245,39 +245,7 @@ DEFUN(cfg_ns, cfg_ns_cmd,
static void dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
{
- struct osmo_sockaddr_str remote;
- struct osmo_sockaddr_str local;
- const struct osmo_sockaddr *sockaddr;
-
- switch (nsvc->ll) {
- case GPRS_NS_LL_UDP: {
- sockaddr = gprs_ns2_ip_vc_remote(nsvc);
- if (!sockaddr) {
- vty_out(vty, "unknown");
- break;
- }
-
- if (osmo_sockaddr_str_from_sockaddr(
- &remote,
- &sockaddr->u.sas)) {
- vty_out(vty, "unknown");
- break;
- }
-
- vty_out(vty, "%s:%u <> %s:%u", local.ip, local.port, remote.ip, remote.port);
- break;
- }
- case GPRS_NS_LL_FR_GRE:
- /* TODO: implement dump_nse for FR GRE */
- case GPRS_NS_LL_E1:
- /* TODO: implement dump_nse for E1 */
- break;
- }
-
- vty_out(vty, "Remote: %s ",
- gprs_ns2_ll_str(nsvc));
-
- vty_out(vty, "%s%s", nsvc->ll == GPRS_NS_LL_UDP ? "UDP" : "FR-GRE", VTY_NEWLINE);
+ vty_out(vty, " %s%s", gprs_ns2_ll_str(nsvc), VTY_NEWLINE);
if (stats) {
vty_out_rate_ctr_group(vty, " ", nsvc->ctrg);