aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-28 19:06:09 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 13:58:13 +0100
commitbf49f042d432780fe37c53aed5e4e3f34ac80793 (patch)
treed2c25383480fb572ccf65cef8fce33f9caa15fc4 /src
parentaa9daa1b9dfc74deb2ab4993f74ba61ee2712f73 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/pcu_vty_functions.cpp21
-rw-r--r--src/pcu_vty_functions.h2
-rw-r--r--src/tbf.cpp22
-rw-r--r--src/tbf.h11
4 files changed, 23 insertions, 33 deletions
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index ce2a006..74780c2 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -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;
diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h
index 1f4ad91..170ad2e 100644
--- a/src/pcu_vty_functions.h
+++ b/src/pcu_vty_functions.h
@@ -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
diff --git a/src/tbf.cpp b/src/tbf.cpp
index ea1b89d..b3d0c0d 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -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);
-}
diff --git a/src/tbf.h b/src/tbf.h
index 190101b..de7063d 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -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