Change in libosmocore[master]: ns2: Improve NSVC output

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

daniel gerrit-no-reply at lists.osmocom.org
Fri Nov 6 15:52:16 UTC 2020


daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/21062 )

Change subject: ns2: Improve NSVC output
......................................................................

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
---
M src/gb/gprs_ns2_vty.c
1 file changed, 1 insertion(+), 33 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index a457361..65fe88e 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -245,39 +245,7 @@
 
 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);

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21062
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6f734d92ec1e17f339f7b32e449ffd614efa7319
Gerrit-Change-Number: 21062
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201106/91604f78/attachment.htm>


More information about the gerrit-log mailing list