aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-03-21 16:18:17 +0100
committerlynxis lazus <lynxis@fe80.eu>2021-03-24 15:42:45 +0000
commit75b6188974728f1f66a65726e1eb481f0d691e7c (patch)
tree8d8e9a4f688eb5cfa41cad3ff789933b8d07dc7f /src
parent6cf65d9d81d4c4d8863d06876b292679513d1fc8 (diff)
gprs_ns2: always use the same method to print NSVCs
The binds also print a list of associated NSVC when dumping the bind. However the binds using their own representation of printing the NSVC which is different to `show ns entities`. Use the same function to print NS-VC. Before: NSVCI 00000: udp)[127.0.0.1]:23000<>[127.0.0.1]:22000 After: NSVCI none: UNCONFIGURED DYNAMIC data_weight=1 sig_weight=1 udp)[127.0.0.1]:23000<>[127.0.0.1]:22000 Change-Id: If31ec6c1c07dc134ab1ddeb915bc89747c7be048
Diffstat (limited to 'src')
-rw-r--r--src/gb/gprs_ns2_fr.c4
-rw-r--r--src/gb/gprs_ns2_internal.h1
-rw-r--r--src/gb/gprs_ns2_udp.c4
-rw-r--r--src/gb/gprs_ns2_vty.c8
4 files changed, 9 insertions, 8 deletions
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 6ba22687..84f37846 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -135,7 +135,7 @@ static void free_vc(struct gprs_ns2_vc *nsvc)
nsvc->priv = NULL;
}
-static void dump_vty(const struct gprs_ns2_vc_bind *bind, struct vty *vty, bool _stats)
+static void dump_vty(const struct gprs_ns2_vc_bind *bind, struct vty *vty, bool stats)
{
struct priv_bind *priv;
struct gprs_ns2_vc *nsvc;
@@ -151,7 +151,7 @@ static void dump_vty(const struct gprs_ns2_vc_bind *bind, struct vty *vty, bool
osmo_fr_role_str(fr_link->role), priv->if_running ? "UP" : "DOWN", VTY_NEWLINE);
llist_for_each_entry(nsvc, &bind->nsvc, blist) {
- vty_out(vty, " NSVCI %05u: %s%s", nsvc->nsvci, gprs_ns2_ll_str(nsvc), VTY_NEWLINE);
+ ns2_vty_dump_nsvc(vty, nsvc, stats);
}
priv = bind->priv;
diff --git a/src/gb/gprs_ns2_internal.h b/src/gb/gprs_ns2_internal.h
index df51ff5e..6cfef444 100644
--- a/src/gb/gprs_ns2_internal.h
+++ b/src/gb/gprs_ns2_internal.h
@@ -396,6 +396,7 @@ int ns2_vc_is_alive(struct gprs_ns2_vc *nsvc);
int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc);
int ns2_vc_block(struct gprs_ns2_vc *nsvc);
int ns2_vc_unblock(struct gprs_ns2_vc *nsvc);
+void ns2_vty_dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats);
/* nse */
void ns2_nse_notify_unblocked(struct gprs_ns2_vc *nsvc, bool unblocked);
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index 5765c773..4c986a29 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -85,7 +85,7 @@ static void free_vc(struct gprs_ns2_vc *nsvc)
}
static void dump_vty(const struct gprs_ns2_vc_bind *bind,
- struct vty *vty, bool _stats)
+ struct vty *vty, bool stats)
{
struct priv_bind *priv;
struct gprs_ns2_vc *nsvc;
@@ -109,7 +109,7 @@ static void dump_vty(const struct gprs_ns2_vc_bind *bind,
vty_out(vty, " %lu NS-VC: %s", nsvcs, VTY_NEWLINE);
llist_for_each_entry(nsvc, &bind->nsvc, blist) {
- vty_out(vty, " NSVCI %05u: %s%s", nsvc->nsvci, gprs_ns2_ll_str(nsvc), VTY_NEWLINE);
+ ns2_vty_dump_nsvc(vty, nsvc, stats);
}
}
diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index 681d1cbd..7cb9ed94 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -1845,7 +1845,7 @@ DEFUN(cfg_no_ns_nse_ip_sns_bind, cfg_no_ns_nse_ip_sns_bind_cmd,
}
/* non-config commands */
-static void dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
+void ns2_vty_dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
{
char nsvci_str[32];
@@ -1877,9 +1877,9 @@ static void dump_nse(struct vty *vty, const struct gprs_ns2_nse *nse, bool stats
llist_for_each_entry(nsvc, &nse->nsvc, list) {
if (persistent_only) {
if (nsvc->persistent)
- dump_nsvc(vty, nsvc, stats);
+ ns2_vty_dump_nsvc(vty, nsvc, stats);
} else {
- dump_nsvc(vty, nsvc, stats);
+ ns2_vty_dump_nsvc(vty, nsvc, stats);
}
}
}
@@ -1989,7 +1989,7 @@ DEFUN(show_nse, show_nse_cmd, "show ns (nsei|nsvc) <0-65535> [stats]",
return CMD_WARNING;
}
- dump_nsvc(vty, nsvc, show_stats);
+ ns2_vty_dump_nsvc(vty, nsvc, show_stats);
}
return CMD_SUCCESS;