Change in libosmocore[master]: gprs_ns2_vty: dump_nsvc: change output depending on NSVCI

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
Tue Jun 15 21:41:14 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/24686 )


Change subject: gprs_ns2_vty: dump_nsvc: change output depending on NSVCI
......................................................................

gprs_ns2_vty: dump_nsvc: change output depending on NSVCI

If the NSVCI is valid, there is no signalling or data weight defined (internally this is 1).
For NSVC with NSVCI don't print the signalling or data weight.
For NSVC without NSVCI, don't print NSVCI at all.

Related: OS#5180
Change-Id: Iaadc806a9136436468e2b02eb0bc1f4570a10ecc
---
M src/gb/gprs_ns2_vty.c
1 file changed, 9 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/86/24686/1

diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index 819e0c8..4932b68 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -1873,18 +1873,17 @@
 /* non-config commands */
 void ns2_vty_dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
 {
-	char nsvci_str[32];
-
 	if (nsvc->nsvci_is_valid)
-		snprintf(nsvci_str, sizeof(nsvci_str), "%05u", nsvc->nsvci);
+		vty_out(vty, "   NSVCI %05u: %s %s %s%s", nsvc->nsvci,
+			osmo_fsm_inst_state_name(nsvc->fi),
+			nsvc->persistent ? "PERSIST" : "DYNAMIC",
+			gprs_ns2_ll_str(nsvc), VTY_NEWLINE);
 	else
-		snprintf(nsvci_str, sizeof(nsvci_str), "none");
-
-	vty_out(vty, "   NSVCI %s: %s %s data_weight=%u sig_weight=%u %s%s", nsvci_str,
-		osmo_fsm_inst_state_name(nsvc->fi),
-		nsvc->persistent ? "PERSIST" : "DYNAMIC",
-		nsvc->data_weight, nsvc->sig_weight,
-		gprs_ns2_ll_str(nsvc), VTY_NEWLINE);
+		vty_out(vty, "   %s %s sig_weight=%u data_weight=%u %s%s",
+			osmo_fsm_inst_state_name(nsvc->fi),
+			nsvc->persistent ? "PERSIST" : "DYNAMIC",
+			nsvc->sig_weight, nsvc->data_weight,
+			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/+/24686
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iaadc806a9136436468e2b02eb0bc1f4570a10ecc
Gerrit-Change-Number: 24686
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/20210615/aa81205e/attachment.htm>


More information about the gerrit-log mailing list