diff options
author | Harald Welte <laforge@osmocom.org> | 2020-12-01 18:17:28 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-12-01 18:19:02 +0100 |
commit | dc2d0808137999d3973f9aad629ebc4e69c3d94e (patch) | |
tree | 85fe741fcf4334140f3d256cff985f95ae836a60 /src/gb/gprs_ns2_vty.c | |
parent | 96ec84a035fb25b36aa2b2fc40a8d2a4ca33ffcd (diff) |
gprs_ns2_vty: Print all relevant data on each NS-VC
After this patch, we can finally see the BLOCKED/UNBLOCKED state,
weights, persistence, etc. in the VTY.
Example:
OsmoGbProxy> show ns entities
NSEI 00101: UDP, DEAD
NSVCI 00101: RESET PERSIST data_weight=1 sig_wight=1 udp)[127.0.0.1]:23000<101>[127.0.0.1]:7777
NSEI 00001: FR, ALIVE
NSVCI 00001: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet1 dlci: 16
NSVCI 00002: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet2 dlci: 17
NSVCI 00003: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet3 dlci: 18
NSVCI 00004: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet4 dlci: 19
Change-Id: I1cf8fe55d1d0cecc46113532c8550880558b0155
Diffstat (limited to 'src/gb/gprs_ns2_vty.c')
-rw-r--r-- | src/gb/gprs_ns2_vty.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c index 17b8d963..b244a96a 100644 --- a/src/gb/gprs_ns2_vty.c +++ b/src/gb/gprs_ns2_vty.c @@ -260,7 +260,18 @@ DEFUN(cfg_ns, cfg_ns_cmd, static void dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats) { - vty_out(vty, " NSVCI %05u %s%s", nsvc->nsvci, gprs_ns2_ll_str(nsvc), VTY_NEWLINE); + char nsvci_str[32]; + + if (nsvc->nsvci_is_valid) + snprintf(nsvci_str, sizeof(nsvci_str), "%05u", nsvc->nsvci); + 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); if (stats) { vty_out_rate_ctr_group(vty, " ", nsvc->ctrg); |