Change in libosmocore[master]: gprs_ns2_vty: make the `show ns entities` and `show ns binds` look si...

lynxis lazus gerrit-no-reply at lists.osmocom.org
Wed Mar 24 15:42:47 UTC 2021


lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/23452 )

Change subject: gprs_ns2_vty: make the `show ns entities` and `show ns binds` look similiar
......................................................................

gprs_ns2_vty: make the `show ns entities` and `show ns binds` look similiar

`show ns binds` prints a count of NSVCs. Add the same line
to `show ns entities`.

Change-Id: I15c58a1c0fe94dda728afb29e7e5ca41e3fa8966
---
M src/gb/gprs_ns2_vty.c
M tests/gb/gprs_ns2_vty.vty
2 files changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index 6d34e5a..9309e9e 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -1869,6 +1869,7 @@
 static void dump_nse(struct vty *vty, const struct gprs_ns2_nse *nse, bool stats, bool persistent_only)
 {
 	struct gprs_ns2_vc *nsvc;
+	unsigned int nsvcs = 0;
 
 	if (persistent_only && !nse->persistent)
 		return;
@@ -1877,6 +1878,10 @@
 		nse->alive ? "ALIVE" : "DEAD", VTY_NEWLINE);
 
 	ns2_sns_dump_vty(vty, " ", nse, stats);
+	llist_for_each_entry(nsvc, &nse->nsvc, list) {
+		nsvcs++;
+	}
+	vty_out(vty, "  %u NS-VC:%s", nsvcs, VTY_NEWLINE);
 	llist_for_each_entry(nsvc, &nse->nsvc, list)
 		ns2_vty_dump_nsvc(vty, nsvc, stats);
 }
diff --git a/tests/gb/gprs_ns2_vty.vty b/tests/gb/gprs_ns2_vty.vty
index 15e541d..a0b0a7e 100644
--- a/tests/gb/gprs_ns2_vty.vty
+++ b/tests/gb/gprs_ns2_vty.vty
@@ -39,6 +39,7 @@
 OsmoNSdummy(config-ns-nse)# end
 OsmoNSdummy# show ns
 NSEI 01234: UDP, DEAD
+  1 NS-VC:
  NSVCI none: RECOVERING PERSIST data_weight=1 sig_weight=1 udp)[127.0.0.14]:42999<>[127.0.0.15]:9496
 UDP bind: 127.0.0.14:42999 DSCP: 0
   IP-SNS signalling weight: 1 data weight: 1
@@ -52,6 +53,7 @@
 OsmoNSdummy(config-ns-nse)# end
 OsmoNSdummy# show ns
 NSEI 01234: UDP, DEAD
+  3 NS-VC:
  NSVCI none: RECOVERING PERSIST data_weight=0 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.17]:9496
  NSVCI none: RECOVERING PERSIST data_weight=9 sig_weight=0 udp)[127.0.0.14]:42999<>[127.0.0.16]:9496
  NSVCI none: RECOVERING PERSIST data_weight=1 sig_weight=1 udp)[127.0.0.14]:42999<>[127.0.0.15]:9496

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I15c58a1c0fe94dda728afb29e7e5ca41e3fa8966
Gerrit-Change-Number: 23452
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
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/20210324/dc9133b2/attachment.htm>


More information about the gerrit-log mailing list