tbf: Add a function to output tbf info to VTY
This commit is contained in:
parent
85c1ea5cb6
commit
afa72f5210
20
src/tbf.cpp
20
src/tbf.cpp
|
@ -1753,3 +1753,23 @@ uint8_t gprs_rlcmac_tbf::tsc() const
|
||||||
{
|
{
|
||||||
return trx->pdch[first_ts].tsc;
|
return trx->pdch[first_ts].tsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tbf_print_vty_info(struct vty *vty, llist_head *ltbf)
|
||||||
|
{
|
||||||
|
gprs_rlcmac_tbf *tbf = llist_entry(ltbf, gprs_rlcmac_tbf, list);
|
||||||
|
|
||||||
|
vty_out(vty, "TBF: TFI=%d TLLI=%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, " state=%08x 1st_TS=%d 1st_cTS=%d ctrl_TS=%d "
|
||||||
|
"MS_CLASS=%d%s",
|
||||||
|
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, "%s%s", VTY_NEWLINE, VTY_NEWLINE);
|
||||||
|
}
|
||||||
|
|
14
src/tbf.h
14
src/tbf.h
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
#include "gprs_rlcmac.h"
|
#include "gprs_rlcmac.h"
|
||||||
#include "llc.h"
|
#include "llc.h"
|
||||||
#include "rlc.h"
|
#include "rlc.h"
|
||||||
|
@ -308,4 +310,16 @@ inline uint16_t gprs_rlcmac_tbf::sns() const
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *tbf_name(gprs_rlcmac_tbf *tbf);
|
const char *tbf_name(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, llist_head *tbf);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue