From ed1fa018c3847f68d3bc54cc8ccb08815e5b6d6f Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Fri, 6 Nov 2020 15:40:27 +0100 Subject: 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 --- src/gb/gprs_ns2_vty.c | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'src/gb/gprs_ns2_vty.c') 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); -- cgit v1.2.3