aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-22 21:48:55 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-22 21:48:55 +0100
commit7c29b094d56c9c4949f05b95eff2d24cfa8f0de8 (patch)
tree94ae1edb8ba5a0117895032d60f142af24f38595 /src
parent09653a0a19ee3006f3c721f51f26ecf2f3ef8452 (diff)
BSC: Add "show subscriber all" command
This command lists the currently-active bsc_subscr and their contents, the format looks like this: OsmoBSC> show subscriber all IMSI TMSI LAC Use 001010123456789 ffffffff 65534 3 001010100000001 a1b2c301 65534 1 Change-Id: Ib9c0c31a0a5a91b42fd832fa0df3460b1a440733
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/osmo_bsc_vty.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c
index f01e6f7e8..fb8b27541 100644
--- a/src/osmo-bsc/osmo_bsc_vty.c
+++ b/src/osmo-bsc/osmo_bsc_vty.c
@@ -929,6 +929,28 @@ DEFUN(logging_fltr_imsi,
return CMD_SUCCESS;
}
+static void dump_one_sub(struct vty *vty, struct bsc_subscr *bsub)
+{
+ vty_out(vty, " %15s %08x %5u %d%s", bsub->imsi, bsub->tmsi, bsub->lac, bsub->use_count,
+ VTY_NEWLINE);
+}
+
+DEFUN(show_subscr_all,
+ show_subscr_all_cmd,
+ "show subscriber all",
+ SHOW_STR "Display information about subscribers\n" "All Subscribers\n")
+{
+ struct bsc_subscr *bsc_subscr;
+
+ vty_out(vty, " IMSI TMSI LAC Use%s", VTY_NEWLINE);
+ /* " 001010123456789 ffffffff 65534 1" */
+
+ llist_for_each_entry(bsc_subscr, bsc_gsmnet->bsc_subscribers, entry)
+ dump_one_sub(vty, bsc_subscr);
+
+ return CMD_SUCCESS;
+}
+
int bsc_vty_init_extra(void)
{
struct gsm_network *net = bsc_gsmnet;
@@ -987,6 +1009,7 @@ int bsc_vty_init_extra(void)
install_element_ve(&show_mscs_cmd);
install_element_ve(&show_pos_cmd);
install_element_ve(&logging_fltr_imsi_cmd);
+ install_element_ve(&show_subscr_all_cmd);
install_element(ENABLE_NODE, &gen_position_trap_cmd);