From 3d6a5d648e0dca3c65c1be42bc1ce617179b4a2c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 14 May 2010 02:08:49 +0800 Subject: [PATCH] [vty] Add a one line show lchan summary command. --- openbsc/src/vty_interface.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c index 41a235551..85530d004 100644 --- a/openbsc/src/vty_interface.c +++ b/openbsc/src/vty_interface.c @@ -683,6 +683,14 @@ static void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan) meas_rep_dump_vty(vty, &lchan->meas_rep[idx], " "); } +static void lchan_dump_short_vty(struct vty *vty, struct gsm_lchan *lchan) +{ + vty_out(vty, "Lchan %u in Timeslot %u of TRX %u in BTS %u, Type %s%s", + lchan->nr, lchan->ts->nr, lchan->ts->trx->nr, + lchan->ts->trx->bts->nr, gsm_lchant_name(lchan->type), + VTY_NEWLINE); +} + static int lchan_summary(struct vty *vty, int argc, const char **argv, void (*dump_cb)(struct vty *, struct gsm_lchan *)) { @@ -764,6 +772,16 @@ DEFUN(show_lchan, return lchan_summary(vty, argc, argv, lchan_dump_full_vty); } +DEFUN(show_lchan_summary, + show_lchan_summary_cmd, + "show lchan summary [bts_nr] [trx_nr] [ts_nr] [lchan_nr]", + SHOW_STR "Display information about a logical channel\n" + "BTS Number\n" "TRX Number\n" "Timeslot Number\n" + "Logical Channel Number\n") +{ + return lchan_summary(vty, argc, argv, lchan_dump_short_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); @@ -1900,6 +1918,7 @@ int bsc_vty_init(struct gsm_network *net) install_element_ve(&show_trx_cmd); install_element_ve(&show_ts_cmd); install_element_ve(&show_lchan_cmd); + install_element_ve(&show_lchan_summary_cmd); install_element_ve(&show_e1drv_cmd); install_element_ve(&show_e1line_cmd);