aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_vty.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-10-09 21:52:50 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-10-09 22:00:54 +0700
commitcef2f843b4236517c6b43365de4c6a8f119a20be (patch)
treee37211fd6a3aba90bce5d9fb674bed4de9497b6d /src/pcu_vty.c
parentafbf189ef28a3f9fd7a95bdf88b90be8e7eb0c5b (diff)
VTY: fix command 'show tbf all': properly filter TBFs
For a long time the VTY command to show all active TBFs was broken. The TBF filtering (by allocation origin) logic allows one to show TBFs allocated on CCCH, PACCH, or on both of them. In the latter case we have been checking whether a TBF was allocated on both logical channels at the same time. Let's fix this by passing a flag-mask instead of boolean arguments. To be able to use GPRS_RLCMAC_FLAG_* definitions from "tbf.h", let's exclude them from "#ifdef __cplusplus ... #endif" block. Change-Id: I1c9f401368af880a97d32905c4cce0da481ffc21
Diffstat (limited to 'src/pcu_vty.c')
-rw-r--r--src/pcu_vty.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 23a42e79..996ce61c 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -1165,13 +1165,14 @@ DEFUN(show_tbf,
"TBFs allocated via PACCH\n")
{
struct gprs_rlcmac_bts *bts = bts_main_data();
- if (!strcmp(argv[0], "all"))
- return pcu_vty_show_tbf_all(vty, bts, true, true);
+ uint32_t flags = UINT32_MAX;
- if (!strcmp(argv[0], "ccch"))
- return pcu_vty_show_tbf_all(vty, bts_main_data(), true, false);
+ if (argv[0][0] == 'c')
+ flags = (1 << GPRS_RLCMAC_FLAG_CCCH);
+ else if (argv[0][0] == 'p')
+ flags = (1 << GPRS_RLCMAC_FLAG_PACCH);
- return pcu_vty_show_tbf_all(vty, bts_main_data(), false, true);
+ return pcu_vty_show_tbf_all(vty, bts, flags);
}
DEFUN(show_ms_all,