tbf/vty: Move tbf_print_vty_info to pcu_vty_functions.cpp

This function is similar to the show_ms function already present in
the target file. Since the TBF lists will be turned into LListHead
based lists, they will get an iteration function in
pcu_vty_functions.cpp, too.

Sponsored-by: On-Waves ehf
This commit is contained in:
Jacob Erlbeck 2015-12-28 19:06:09 +01:00
parent aa9daa1b9d
commit bf49f042d4
4 changed files with 23 additions and 33 deletions

View File

@ -39,6 +39,27 @@ int pcu_vty_config_write_pcu_ext(struct vty *vty)
return CMD_SUCCESS;
}
void tbf_print_vty_info(struct vty *vty, struct llist_head *ltbf)
{
gprs_rlcmac_tbf *tbf = llist_pods_entry(ltbf, gprs_rlcmac_tbf);
vty_out(vty, "TBF: TFI=%d TLLI=0x%08x (%s) DIR=%s IMSI=%s%s", tbf->tfi(),
tbf->tlli(), tbf->is_tlli_valid() ? "valid" : "invalid",
tbf->direction == GPRS_RLCMAC_UL_TBF ? "UL" : "DL",
tbf->imsi(), VTY_NEWLINE);
vty_out(vty, " created=%lu state=%08x 1st_TS=%d 1st_cTS=%d ctrl_TS=%d "
"MS_CLASS=%d%s",
tbf->created_ts(), tbf->state_flags, tbf->first_ts,
tbf->first_common_ts, tbf->control_ts, tbf->ms_class(),
VTY_NEWLINE);
vty_out(vty, " TS_alloc=");
for (int i = 0; i < 8; i++) {
if (tbf->pdch[i])
vty_out(vty, "%d ", i);
}
vty_out(vty, " CS=%d%s%s", tbf->ms() ? tbf->ms()->current_cs_dl() : 1,
VTY_NEWLINE, VTY_NEWLINE);
}
int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data)
{
BTS *bts = bts_data->bts;

View File

@ -34,6 +34,8 @@ int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data,
int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts_data,
const char *imsi);
void tbf_print_vty_info(struct vty *vty, struct llist_head *tbf);
#ifdef __cplusplus
}
#endif

View File

@ -1140,25 +1140,3 @@ uint8_t gprs_rlcmac_tbf::ul_slots() const
return slots;
}
void tbf_print_vty_info(struct vty *vty, struct llist_head *ltbf)
{
gprs_rlcmac_tbf *tbf = llist_pods_entry(ltbf, gprs_rlcmac_tbf);
vty_out(vty, "TBF: TFI=%d TLLI=0x%08x (%s) DIR=%s IMSI=%s%s", tbf->tfi(),
tbf->tlli(), tbf->is_tlli_valid() ? "valid" : "invalid",
tbf->direction == GPRS_RLCMAC_UL_TBF ? "UL" : "DL",
tbf->imsi(), VTY_NEWLINE);
vty_out(vty, " created=%lu state=%08x 1st_TS=%d 1st_cTS=%d ctrl_TS=%d "
"MS_CLASS=%d%s",
tbf->created_ts(), tbf->state_flags, tbf->first_ts,
tbf->first_common_ts, tbf->control_ts, tbf->ms_class(),
VTY_NEWLINE);
vty_out(vty, " TS_alloc=");
for (int i = 0; i < 8; i++) {
if (tbf->pdch[i])
vty_out(vty, "%d ", i);
}
vty_out(vty, " CS=%d%s%s", tbf->ms() ? tbf->ms()->current_cs_dl() : 1,
VTY_NEWLINE, VTY_NEWLINE);
}

View File

@ -470,14 +470,3 @@ inline gprs_rlcmac_dl_tbf *as_dl_tbf(gprs_rlcmac_tbf *tbf)
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <osmocom/vty/command.h>
#include <osmocom/vty/vty.h>
void tbf_print_vty_info(struct vty *vty, struct llist_head *tbf);
#ifdef __cplusplus
}
#endif