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
This commit is contained in:
Daniel Willmann 2020-11-06 15:40:27 +01:00
parent 15c09a81e9
commit ed1fa018c3
1 changed files with 1 additions and 33 deletions

View File

@ -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);