diff options
Diffstat (limited to 'openbsc/src/vty_interface.c')
-rw-r--r-- | openbsc/src/vty_interface.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c index 880c9910d..945b571a6 100644 --- a/openbsc/src/vty_interface.c +++ b/openbsc/src/vty_interface.c @@ -779,6 +779,17 @@ static void lchan_dump_short_vty(struct vty *vty, struct gsm_lchan *lchan) VTY_NEWLINE); } +static void lchan_dump_status_vty(struct vty *vty, struct gsm_lchan *lchan) +{ + vty_out(vty, "Lchan: %u/%u/%u/%u Type: %s State: %s ref: %u Subscriber: %d " + "Time: %lu %s", + lchan->nr, lchan->ts->nr, lchan->ts->trx->nr, + lchan->ts->trx->bts->nr, gsm_lchant_name(lchan->type), + gsm_lchans_name(lchan->state), lchan->conn.use_count, + lchan->conn.subscr != NULL, (unsigned long) lchan->alloc_time.tv_sec, + VTY_NEWLINE); +} + static int lchan_summary(struct vty *vty, int argc, const char **argv, void (*dump_cb)(struct vty *, struct gsm_lchan *)) { @@ -865,6 +876,14 @@ DEFUN(show_lchan_summary, return lchan_summary(vty, argc, argv, lchan_dump_short_vty); } +DEFUN(show_lchan_status, + show_lchan_status_cmd, + "show lchan-status [bts_nr] [trx_nr] [ts_nr] [lchan_nr]", + SHOW_STR "Display a short stat about a logical channel\n") +{ + return lchan_summary(vty, argc, argv, lchan_dump_status_vty); +} + static void e1drv_dump_vty(struct vty *vty, struct e1inp_driver *drv) { vty_out(vty, "E1 Input Driver %s%s", drv->name, VTY_NEWLINE); @@ -2171,6 +2190,7 @@ int bsc_vty_init(struct gsm_network *net) install_element(VIEW_NODE, &show_ts_cmd); install_element(VIEW_NODE, &show_lchan_cmd); install_element(VIEW_NODE, &show_lchan_summary_cmd); + install_element(VIEW_NODE, &show_lchan_status_cmd); install_element(VIEW_NODE, &show_e1drv_cmd); install_element(VIEW_NODE, &show_e1line_cmd); |