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

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/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Mon Mar 22 12:21:18 UTC 2021


lynxis lazus has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/23452/1

diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index 8a400e0..e907ee3 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -1720,6 +1720,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;
@@ -1728,6 +1729,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 67838e9..24e4b6a 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: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210322/cafb77ad/attachment.htm>


More information about the gerrit-log mailing list