2015-06-04 07:42:14 +00:00
|
|
|
/* pcu_vty_functions.cpp
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 by Sysmocom s.f.m.c. GmbH
|
|
|
|
* Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
/* OsmoBTS VTY interface */
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "pcu_vty_functions.h"
|
2015-06-04 08:23:24 +00:00
|
|
|
#include "bts.h"
|
|
|
|
#include "gprs_ms_storage.h"
|
|
|
|
#include "gprs_ms.h"
|
|
|
|
#include "cxx_linuxlist.h"
|
2018-01-26 12:31:42 +00:00
|
|
|
#include <llc.h>
|
|
|
|
#include <pcu_l1_if.h>
|
|
|
|
#include <rlc.h>
|
|
|
|
#include <tbf.h>
|
2019-09-25 15:47:02 +00:00
|
|
|
#include <tbf_ul.h>
|
2018-02-19 16:17:28 +00:00
|
|
|
#include <pdch.h>
|
2015-06-04 07:42:14 +00:00
|
|
|
|
|
|
|
extern "C" {
|
2018-01-25 14:41:28 +00:00
|
|
|
#include <osmocom/vty/command.h>
|
|
|
|
#include <osmocom/vty/logging.h>
|
|
|
|
#include <osmocom/vty/misc.h>
|
2018-01-26 12:31:42 +00:00
|
|
|
#include <osmocom/core/linuxlist.h>
|
|
|
|
#include <osmocom/core/utils.h>
|
|
|
|
#include <osmocom/vty/vty.h>
|
2019-03-05 13:59:03 +00:00
|
|
|
#include "coding_scheme.h"
|
2015-06-04 07:42:14 +00:00
|
|
|
}
|
|
|
|
|
2021-05-13 16:39:36 +00:00
|
|
|
static void tbf_print_vty_info(struct vty *vty, struct gprs_rlcmac_tbf *tbf)
|
2015-12-28 18:06:09 +00:00
|
|
|
{
|
2016-01-19 16:10:07 +00:00
|
|
|
gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf);
|
|
|
|
gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf);
|
|
|
|
|
2017-11-01 19:00:08 +00:00
|
|
|
vty_out(vty, "TBF: TFI=%d TLLI=0x%08x (%s) TA=%u DIR=%s IMSI=%s%s", tbf->tfi(),
|
2020-09-22 14:15:09 +00:00
|
|
|
tbf->tlli(), tbf->is_tlli_valid() ? "valid" : "invalid",
|
|
|
|
tbf->ta(),
|
|
|
|
tbf->direction == GPRS_RLCMAC_UL_TBF ? "UL" : "DL",
|
|
|
|
tbf->imsi(), VTY_NEWLINE);
|
2021-11-05 19:43:10 +00:00
|
|
|
vty_out(vty, " created=%lu state=%s flags=%08x [CCCH:%u, PACCH:%u] 1st_TS=%d 1st_cTS=%d ctrl_TS=%d MS_CLASS=%d/%d%s",
|
|
|
|
tbf->created_ts(), tbf->state_name(),
|
|
|
|
tbf->state_fsm.state_flags,
|
2021-07-22 17:20:50 +00:00
|
|
|
tbf->state_fsm.state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH),
|
|
|
|
tbf->state_fsm.state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH),
|
2018-01-30 16:49:53 +00:00
|
|
|
tbf->first_ts,
|
2020-09-22 14:15:09 +00:00
|
|
|
tbf->first_common_ts, tbf->control_ts,
|
|
|
|
tbf->ms_class(),
|
2021-11-05 19:46:06 +00:00
|
|
|
ms_egprs_ms_class(tbf->ms()),
|
2020-09-22 14:15:09 +00:00
|
|
|
VTY_NEWLINE);
|
2015-12-28 18:06:09 +00:00
|
|
|
vty_out(vty, " TS_alloc=");
|
|
|
|
for (int i = 0; i < 8; i++) {
|
2016-01-28 15:14:58 +00:00
|
|
|
bool is_ctrl = tbf->is_control_ts(i);
|
2015-12-28 18:06:09 +00:00
|
|
|
if (tbf->pdch[i])
|
2016-01-28 15:14:58 +00:00
|
|
|
vty_out(vty, "%d%s ", i, is_ctrl ? "!" : "");
|
2015-12-28 18:06:09 +00:00
|
|
|
}
|
2016-10-26 10:11:56 +00:00
|
|
|
if (tbf->trx != NULL)
|
|
|
|
vty_out(vty, " TRX_ID=%d", tbf->trx->trx_no);
|
2019-03-05 13:59:03 +00:00
|
|
|
vty_out(vty, " CS=%s", mcs_name(tbf->current_cs()));
|
2016-01-19 16:10:07 +00:00
|
|
|
|
|
|
|
if (ul_tbf) {
|
2020-10-23 19:00:23 +00:00
|
|
|
gprs_rlc_ul_window *win = static_cast<gprs_rlc_ul_window *>(ul_tbf->window());
|
2017-12-15 10:21:57 +00:00
|
|
|
vty_out(vty, " WS=%u V(Q)=%d V(R)=%d",
|
|
|
|
ul_tbf->window_size(), win->v_q(), win->v_r());
|
2016-12-16 07:27:18 +00:00
|
|
|
vty_out(vty, "%s", VTY_NEWLINE);
|
|
|
|
vty_out(vty, " TBF Statistics:%s", VTY_NEWLINE);
|
vty: Avoid crash in tbf_print_vty_info with null ptr ctrg
Previous code did use a ctrg based on MS being EGPRS capable or not.
However, an MS being EGPRS capable doesn't mean necessarily that all its
TBFs are EGPRS, since we may known about the capability after we already
created some previous TBF, so it was not ugpraded. Hence, we were
sometimes accessing the wrong NULL ctrg.
Let's simply check for non NULL ctrg when deciding what to print.
"""
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
82 utils.c: No such file or directory.
(gdb) bt
#0 0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
#1 0x000000000041437b in tbf_print_vty_info (vty=vty@entry=0x897850, tbf=0x3fb61f0) at pcu_vty_functions.cpp:98
#2 0x0000000000414acc in pcu_vty_show_tbf_all (vty=vty@entry=0x897850, bts=bts@entry=0x7be650, flags=4294967295) at pcu_vty_functions.cpp:127
#3 0x000000000041206f in show_tbf (self=<optimized out>, vty=0x897850, argc=<optimized out>, argv=0x7fffffffe040) at pcu_vty.c:1150
#4 0x00007ffff755d167 in cmd_execute_command_real (vline=vline@entry=0x7bc300, vty=vty@entry=0x897850, cmd=<optimized out>) at command.c:2604
"""
Related: SYS#5689
Change-Id: I3979bfc12dd3b9a53b34b284537f271c356a3024
2021-11-05 12:36:49 +00:00
|
|
|
if (ul_tbf->m_ul_gprs_ctrs)
|
2016-12-16 07:27:18 +00:00
|
|
|
vty_out_rate_ctr_group(vty, " ", ul_tbf->m_ul_gprs_ctrs);
|
vty: Avoid crash in tbf_print_vty_info with null ptr ctrg
Previous code did use a ctrg based on MS being EGPRS capable or not.
However, an MS being EGPRS capable doesn't mean necessarily that all its
TBFs are EGPRS, since we may known about the capability after we already
created some previous TBF, so it was not ugpraded. Hence, we were
sometimes accessing the wrong NULL ctrg.
Let's simply check for non NULL ctrg when deciding what to print.
"""
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
82 utils.c: No such file or directory.
(gdb) bt
#0 0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
#1 0x000000000041437b in tbf_print_vty_info (vty=vty@entry=0x897850, tbf=0x3fb61f0) at pcu_vty_functions.cpp:98
#2 0x0000000000414acc in pcu_vty_show_tbf_all (vty=vty@entry=0x897850, bts=bts@entry=0x7be650, flags=4294967295) at pcu_vty_functions.cpp:127
#3 0x000000000041206f in show_tbf (self=<optimized out>, vty=0x897850, argc=<optimized out>, argv=0x7fffffffe040) at pcu_vty.c:1150
#4 0x00007ffff755d167 in cmd_execute_command_real (vline=vline@entry=0x7bc300, vty=vty@entry=0x897850, cmd=<optimized out>) at command.c:2604
"""
Related: SYS#5689
Change-Id: I3979bfc12dd3b9a53b34b284537f271c356a3024
2021-11-05 12:36:49 +00:00
|
|
|
if (ul_tbf->m_ul_egprs_ctrs)
|
2016-12-16 07:27:18 +00:00
|
|
|
vty_out_rate_ctr_group(vty, " ", ul_tbf->m_ul_egprs_ctrs);
|
2016-01-19 16:10:07 +00:00
|
|
|
}
|
|
|
|
if (dl_tbf) {
|
2020-10-23 19:00:23 +00:00
|
|
|
gprs_rlc_dl_window *win = static_cast<gprs_rlc_dl_window *>(dl_tbf->window());
|
2017-12-15 10:21:57 +00:00
|
|
|
vty_out(vty, " WS=%u V(A)=%d V(S)=%d nBSN=%d%s",
|
|
|
|
dl_tbf->window_size(), win->v_a(), win->v_s(), win->resend_needed(),
|
2016-01-19 16:10:07 +00:00
|
|
|
win->window_stalled() ? " STALLED" : "");
|
2016-12-08 11:45:17 +00:00
|
|
|
vty_out(vty, "%s", VTY_NEWLINE);
|
|
|
|
vty_out_rate_ctr_group(vty, " ", tbf->m_ctrs);
|
vty: Avoid crash in tbf_print_vty_info with null ptr ctrg
Previous code did use a ctrg based on MS being EGPRS capable or not.
However, an MS being EGPRS capable doesn't mean necessarily that all its
TBFs are EGPRS, since we may known about the capability after we already
created some previous TBF, so it was not ugpraded. Hence, we were
sometimes accessing the wrong NULL ctrg.
Let's simply check for non NULL ctrg when deciding what to print.
"""
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
82 utils.c: No such file or directory.
(gdb) bt
#0 0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
#1 0x000000000041437b in tbf_print_vty_info (vty=vty@entry=0x897850, tbf=0x3fb61f0) at pcu_vty_functions.cpp:98
#2 0x0000000000414acc in pcu_vty_show_tbf_all (vty=vty@entry=0x897850, bts=bts@entry=0x7be650, flags=4294967295) at pcu_vty_functions.cpp:127
#3 0x000000000041206f in show_tbf (self=<optimized out>, vty=0x897850, argc=<optimized out>, argv=0x7fffffffe040) at pcu_vty.c:1150
#4 0x00007ffff755d167 in cmd_execute_command_real (vline=vline@entry=0x7bc300, vty=vty@entry=0x897850, cmd=<optimized out>) at command.c:2604
"""
Related: SYS#5689
Change-Id: I3979bfc12dd3b9a53b34b284537f271c356a3024
2021-11-05 12:36:49 +00:00
|
|
|
if (dl_tbf->m_dl_gprs_ctrs)
|
2016-12-08 11:45:17 +00:00
|
|
|
vty_out_rate_ctr_group(vty, " ", dl_tbf->m_dl_gprs_ctrs);
|
vty: Avoid crash in tbf_print_vty_info with null ptr ctrg
Previous code did use a ctrg based on MS being EGPRS capable or not.
However, an MS being EGPRS capable doesn't mean necessarily that all its
TBFs are EGPRS, since we may known about the capability after we already
created some previous TBF, so it was not ugpraded. Hence, we were
sometimes accessing the wrong NULL ctrg.
Let's simply check for non NULL ctrg when deciding what to print.
"""
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
82 utils.c: No such file or directory.
(gdb) bt
#0 0x00007ffff7561ea6 in vty_out_rate_ctr_group (vty=vty@entry=0x897850, prefix=prefix@entry=0x4482cd " ", ctrg=0x0) at utils.c:82
#1 0x000000000041437b in tbf_print_vty_info (vty=vty@entry=0x897850, tbf=0x3fb61f0) at pcu_vty_functions.cpp:98
#2 0x0000000000414acc in pcu_vty_show_tbf_all (vty=vty@entry=0x897850, bts=bts@entry=0x7be650, flags=4294967295) at pcu_vty_functions.cpp:127
#3 0x000000000041206f in show_tbf (self=<optimized out>, vty=0x897850, argc=<optimized out>, argv=0x7fffffffe040) at pcu_vty.c:1150
#4 0x00007ffff755d167 in cmd_execute_command_real (vline=vline@entry=0x7bc300, vty=vty@entry=0x897850, cmd=<optimized out>) at command.c:2604
"""
Related: SYS#5689
Change-Id: I3979bfc12dd3b9a53b34b284537f271c356a3024
2021-11-05 12:36:49 +00:00
|
|
|
if (dl_tbf->m_dl_egprs_ctrs)
|
2016-12-08 11:45:17 +00:00
|
|
|
vty_out_rate_ctr_group(vty, " ", dl_tbf->m_dl_egprs_ctrs);
|
2016-01-19 16:10:07 +00:00
|
|
|
}
|
|
|
|
vty_out(vty, "%s%s", VTY_NEWLINE, VTY_NEWLINE);
|
2015-12-28 18:06:09 +00:00
|
|
|
}
|
|
|
|
|
2021-01-14 15:48:38 +00:00
|
|
|
int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts, uint32_t flags)
|
2015-12-28 18:15:40 +00:00
|
|
|
{
|
2021-01-14 15:48:38 +00:00
|
|
|
struct llist_item *iter;
|
2021-05-13 16:39:36 +00:00
|
|
|
const struct gprs_rlcmac_trx *trx;
|
2021-01-14 15:48:38 +00:00
|
|
|
struct gprs_rlcmac_tbf *tbf;
|
2021-05-13 16:39:36 +00:00
|
|
|
size_t trx_no;
|
2015-12-28 18:15:40 +00:00
|
|
|
|
|
|
|
vty_out(vty, "UL TBFs%s", VTY_NEWLINE);
|
2021-05-13 16:39:36 +00:00
|
|
|
for (trx_no = 0; trx_no < ARRAY_SIZE(bts->trx); trx_no++) {
|
|
|
|
trx = &bts->trx[trx_no];
|
|
|
|
llist_for_each_entry(iter, &trx->ul_tbfs, list) {
|
|
|
|
tbf = (struct gprs_rlcmac_tbf *)iter->entry;
|
2021-07-22 17:20:50 +00:00
|
|
|
if (tbf->state_fsm.state_flags & flags)
|
2021-05-13 16:39:36 +00:00
|
|
|
tbf_print_vty_info(vty, tbf);
|
|
|
|
}
|
2019-10-09 14:52:50 +00:00
|
|
|
}
|
2015-12-28 18:15:40 +00:00
|
|
|
|
|
|
|
vty_out(vty, "%sDL TBFs%s", VTY_NEWLINE, VTY_NEWLINE);
|
2021-05-13 16:39:36 +00:00
|
|
|
for (trx_no = 0; trx_no < ARRAY_SIZE(bts->trx); trx_no++) {
|
|
|
|
trx = &bts->trx[trx_no];
|
|
|
|
llist_for_each_entry(iter, &trx->dl_tbfs, list) {
|
|
|
|
tbf = (struct gprs_rlcmac_tbf *)iter->entry;
|
2021-07-22 17:20:50 +00:00
|
|
|
if (tbf->state_fsm.state_flags & flags)
|
2021-05-13 16:39:36 +00:00
|
|
|
tbf_print_vty_info(vty, tbf);
|
|
|
|
}
|
2019-10-09 14:52:50 +00:00
|
|
|
}
|
2015-12-28 18:15:40 +00:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-06-05 14:33:33 +00:00
|
|
|
static int show_ms(struct vty *vty, GprsMs *ms)
|
|
|
|
{
|
2015-06-11 14:54:50 +00:00
|
|
|
unsigned i;
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
struct llist_item *i_tbf;
|
2016-01-22 16:06:14 +00:00
|
|
|
uint8_t slots;
|
2015-06-11 14:54:50 +00:00
|
|
|
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
vty_out(vty, "MS TLLI=%08x, IMSI=%s%s", ms_tlli(ms), ms_imsi(ms), VTY_NEWLINE);
|
|
|
|
vty_out(vty, " Timing advance (TA): %d%s", ms_ta(ms), VTY_NEWLINE);
|
|
|
|
vty_out(vty, " Coding scheme uplink: %s%s", mcs_name(ms_current_cs_ul(ms)),
|
2015-06-05 14:33:33 +00:00
|
|
|
VTY_NEWLINE);
|
2021-01-25 11:05:32 +00:00
|
|
|
vty_out(vty, " Coding scheme downlink: %s%s", mcs_name(ms_current_cs_dl(ms, ms_mode(ms))),
|
2015-06-05 14:33:33 +00:00
|
|
|
VTY_NEWLINE);
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
vty_out(vty, " Mode: %s%s", mode_name(ms_mode(ms)), VTY_NEWLINE);
|
|
|
|
vty_out(vty, " MS class: %d%s", ms_ms_class(ms), VTY_NEWLINE);
|
|
|
|
vty_out(vty, " EGPRS MS class: %d%s", ms_egprs_ms_class(ms), VTY_NEWLINE);
|
2016-01-22 16:06:14 +00:00
|
|
|
vty_out(vty, " PACCH: ");
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
slots = ms_current_pacch_slots(ms);
|
2016-01-22 16:06:14 +00:00
|
|
|
for (int i = 0; i < 8; i++)
|
|
|
|
if (slots & (1 << i))
|
|
|
|
vty_out(vty, "%d ", i);
|
|
|
|
vty_out(vty, "%s", VTY_NEWLINE);
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
vty_out(vty, " LLC queue length: %zd%s", llc_queue_size(ms_llc_queue(ms)),
|
2015-06-05 14:33:33 +00:00
|
|
|
VTY_NEWLINE);
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
vty_out(vty, " LLC queue octets: %zd%s", llc_queue_octets(ms_llc_queue(ms)),
|
2015-08-21 14:02:11 +00:00
|
|
|
VTY_NEWLINE);
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
if (ms->l1_meas.have_rssi)
|
2015-06-08 09:26:38 +00:00
|
|
|
vty_out(vty, " RSSI: %d dBm%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms->l1_meas.rssi, VTY_NEWLINE);
|
|
|
|
if (ms->l1_meas.have_ber)
|
2015-06-08 09:26:38 +00:00
|
|
|
vty_out(vty, " Bit error rate: %d %%%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms->l1_meas.ber, VTY_NEWLINE);
|
|
|
|
if (ms->l1_meas.have_link_qual)
|
2015-06-08 09:26:38 +00:00
|
|
|
vty_out(vty, " Link quality: %d dB%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms->l1_meas.link_qual, VTY_NEWLINE);
|
|
|
|
if (ms->l1_meas.have_bto)
|
2015-06-08 09:26:38 +00:00
|
|
|
vty_out(vty, " Burst timing offset: %d/4 bit%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms->l1_meas.bto, VTY_NEWLINE);
|
|
|
|
if (ms->l1_meas.have_ms_rx_qual)
|
2015-06-12 14:01:56 +00:00
|
|
|
vty_out(vty, " Downlink NACK rate: %d %%%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms_nack_rate_dl(ms), VTY_NEWLINE);
|
|
|
|
if (ms->l1_meas.have_ms_rx_qual)
|
2015-06-11 14:54:50 +00:00
|
|
|
vty_out(vty, " MS RX quality: %d %%%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms->l1_meas.ms_rx_qual, VTY_NEWLINE);
|
|
|
|
if (ms->l1_meas.have_ms_c_value)
|
2015-06-11 14:54:50 +00:00
|
|
|
vty_out(vty, " MS C value: %d dB%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms->l1_meas.ms_c_value, VTY_NEWLINE);
|
|
|
|
if (ms->l1_meas.have_ms_sign_var)
|
2015-06-11 14:54:50 +00:00
|
|
|
vty_out(vty, " MS SIGN variance: %d dB%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms->l1_meas.ms_sign_var, VTY_NEWLINE);
|
|
|
|
for (i = 0; i < ARRAY_SIZE(ms->l1_meas.ts); ++i) {
|
|
|
|
if (ms->l1_meas.ts[i].have_ms_i_level)
|
2015-06-11 14:54:50 +00:00
|
|
|
vty_out(vty, " MS I level (slot %d): %d dB%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
i, ms->l1_meas.ts[i].ms_i_level, VTY_NEWLINE);
|
2015-06-11 14:54:50 +00:00
|
|
|
}
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
if (ms_ul_tbf(ms))
|
2015-06-05 14:33:33 +00:00
|
|
|
vty_out(vty, " Uplink TBF: TFI=%d, state=%s%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms_ul_tbf(ms)->tfi(),
|
|
|
|
ms_ul_tbf(ms)->state_name(),
|
2015-06-05 14:33:33 +00:00
|
|
|
VTY_NEWLINE);
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
if (ms_dl_tbf(ms)) {
|
2015-06-05 14:33:33 +00:00
|
|
|
vty_out(vty, " Downlink TBF: TFI=%d, state=%s%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms_dl_tbf(ms)->tfi(),
|
|
|
|
ms_dl_tbf(ms)->state_name(),
|
2015-06-05 14:33:33 +00:00
|
|
|
VTY_NEWLINE);
|
2016-12-08 11:45:17 +00:00
|
|
|
vty_out(vty, " Current DL Throughput: %d Kbps %s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
ms_dl_tbf(ms)->m_bw.dl_throughput,
|
2016-12-08 11:45:17 +00:00
|
|
|
VTY_NEWLINE);
|
|
|
|
}
|
2015-06-05 14:33:33 +00:00
|
|
|
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
llist_for_each_entry(i_tbf, &ms->old_tbfs, list) {
|
|
|
|
struct gprs_rlcmac_tbf *tbf = (struct gprs_rlcmac_tbf *)i_tbf->entry;
|
2015-08-21 13:46:16 +00:00
|
|
|
vty_out(vty, " Old %-19s TFI=%d, state=%s%s",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
tbf_direction(tbf) == GPRS_RLCMAC_UL_TBF ?
|
2015-08-21 13:46:16 +00:00
|
|
|
"Uplink TBF:" : "Downlink TBF:",
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
tbf->tfi(),
|
|
|
|
tbf->state_name(),
|
2015-08-21 13:46:16 +00:00
|
|
|
VTY_NEWLINE);
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
}
|
2021-01-11 16:32:18 +00:00
|
|
|
vty_out_rate_ctr_group(vty, " ", ms->ctrs);
|
2015-08-21 13:46:16 +00:00
|
|
|
|
2015-06-05 14:33:33 +00:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2021-01-14 15:48:38 +00:00
|
|
|
int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts)
|
2019-10-09 13:26:47 +00:00
|
|
|
{
|
2021-01-14 11:12:43 +00:00
|
|
|
struct llist_head *tmp;
|
2019-10-09 13:26:47 +00:00
|
|
|
|
2021-01-14 15:48:38 +00:00
|
|
|
llist_for_each(tmp, bts_ms_store(bts)->ms_list()) {
|
2021-01-14 11:12:43 +00:00
|
|
|
GprsMs *ms_iter = llist_entry(tmp, typeof(*ms_iter), list);
|
Convert GprsMS and helpers classes to C
As we integrate osmo-pcu more and more with libosmocore features, it
becomes really hard to use them since libosmocore relies heavily on C
specific compilation features, which are not available in old C++
compilers (such as designated initializers for complex types in FSMs).
GprsMs is right now a quite simple object since initial design of
osmo-pcu made it optional and most of the logic was placed and stored
duplicated in TBF objects. However, that's changing as we introduce more
features, with the GprsMS class getting more weight. Hence, let's move
it now to be a C struct in order to be able to easily use libosmocore
features there, such as FSMs.
Some helper classes which GprsMs uses are also mostly move to C since
they are mostly structs with methods, so there's no point in having
duplicated APIs for C++ and C for such simple cases.
For some more complex classes, like (ul_,dl_)tbf, C API bindings are
added where needed so that GprsMs can use functionalitites from that
class. Most of those APIs can be kept afterwards and drop the C++ ones
since they provide no benefit in general.
Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-12-16 14:59:45 +00:00
|
|
|
show_ms(vty, ms_iter);
|
2021-01-14 11:12:43 +00:00
|
|
|
}
|
2019-10-09 13:26:47 +00:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2021-01-14 15:48:38 +00:00
|
|
|
int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts,
|
2015-06-05 14:33:33 +00:00
|
|
|
uint32_t tlli)
|
|
|
|
{
|
2021-01-14 15:48:38 +00:00
|
|
|
GprsMs *ms = bts_ms_store(bts)->get_ms(tlli);
|
2015-06-05 14:33:33 +00:00
|
|
|
if (!ms) {
|
|
|
|
vty_out(vty, "Unknown TLLI %08x.%s", tlli, VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return show_ms(vty, ms);
|
|
|
|
}
|
|
|
|
|
2021-01-14 15:48:38 +00:00
|
|
|
int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts,
|
2015-06-05 14:33:33 +00:00
|
|
|
const char *imsi)
|
|
|
|
{
|
2021-01-14 15:48:38 +00:00
|
|
|
GprsMs *ms = bts_ms_store(bts)->get_ms(0, 0, imsi);
|
2015-06-05 14:33:33 +00:00
|
|
|
if (!ms) {
|
|
|
|
vty_out(vty, "Unknown IMSI '%s'.%s", imsi, VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return show_ms(vty, ms);
|
|
|
|
}
|
2020-09-22 15:01:31 +00:00
|
|
|
|
2021-01-18 11:53:54 +00:00
|
|
|
int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts)
|
2020-09-22 15:01:31 +00:00
|
|
|
{
|
|
|
|
unsigned int trx_nr, ts_nr;
|
|
|
|
|
2021-01-18 16:14:14 +00:00
|
|
|
vty_out(vty, "BTS%" PRIu8 " (%s)%s", bts->nr, bts->active ? "active" : "disabled", VTY_NEWLINE);
|
2021-01-18 11:53:54 +00:00
|
|
|
for (trx_nr = 0; trx_nr < ARRAY_SIZE(bts->trx); trx_nr++) {
|
|
|
|
const struct gprs_rlcmac_trx *trx = &bts->trx[trx_nr];
|
2020-09-22 15:01:31 +00:00
|
|
|
|
|
|
|
for (ts_nr = 0; ts_nr < ARRAY_SIZE(trx->pdch); ts_nr++) {
|
|
|
|
if (trx->pdch[ts_nr].is_enabled())
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (ts_nr == ARRAY_SIZE(trx->pdch))
|
|
|
|
continue; /* no pdch active, skip */
|
|
|
|
|
|
|
|
vty_out(vty, " TRX%u%s", trx->trx_no, VTY_NEWLINE);
|
|
|
|
for (ts_nr = 0; ts_nr < ARRAY_SIZE(trx->pdch); ts_nr++) {
|
|
|
|
const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts_nr];
|
|
|
|
|
|
|
|
vty_out(vty, " TS%u: PDCH %s, %u UL TBFs, %u DL TBFs%s", pdch->ts_no,
|
|
|
|
pdch->is_enabled() ? "enabled" : "disabled",
|
|
|
|
pdch->num_tbfs(GPRS_RLCMAC_DL_TBF),
|
|
|
|
pdch->num_tbfs(GPRS_RLCMAC_UL_TBF), VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|