diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-12-28 19:15:40 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-01 13:58:13 +0100 |
commit | ed2dbf6954b9883218f5ace1d801c0e316df912a (patch) | |
tree | 1f8a44144bacbad9ca3d7bd947a5a2c8d1cbd726 /src/pcu_vty_functions.cpp | |
parent | bf49f042d432780fe37c53aed5e4e3f34ac80793 (diff) |
tbf: Use LListHead instead of llist_pods
LListHead does basically the same like llist_pods, but more C++ish
and with type safety.
This commit turns the former list field of gprs_rlcmac_tbf into a
private field, provides accessors, moves the related code from
pcu_vty.c to pcu_vty_functions.cpp, and removes the llist_pods
type and related code.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/pcu_vty_functions.cpp')
-rw-r--r-- | src/pcu_vty_functions.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 74780c2c..7082d990 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -39,9 +39,8 @@ 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) +static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf) { - 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", @@ -60,6 +59,22 @@ void tbf_print_vty_info(struct vty *vty, struct llist_head *ltbf) VTY_NEWLINE, VTY_NEWLINE); } +int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data) +{ + BTS *bts = bts_data->bts; + LListHead<gprs_rlcmac_tbf> *ms_iter; + + vty_out(vty, "UL TBFs%s", VTY_NEWLINE); + llist_for_each(ms_iter, &bts->ul_tbfs()) + tbf_print_vty_info(vty, ms_iter->entry()); + + vty_out(vty, "%sDL TBFs%s", VTY_NEWLINE, VTY_NEWLINE); + llist_for_each(ms_iter, &bts->dl_tbfs()) + tbf_print_vty_info(vty, ms_iter->entry()); + + return CMD_SUCCESS; +} + int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data) { BTS *bts = bts_data->bts; |