bsc vty: Provide a show mscs command to show the state of each MSC
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
index 8cf5a14..276a490 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
@@ -356,6 +356,23 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(show_mscs,
+      show_mscs_cmd,
+      "show mscs",
+      SHOW_STR "MSC Connections and State\n")
+{
+	struct osmo_msc_data *msc;
+	llist_for_each_entry(msc, &bsc_gsmnet->bsc_data->mscs, entry) {
+		vty_out(vty, "MSC Nr: %d is connected: %d auth: %d.%s",
+			msc->nr,
+			msc->msc_con ? msc->msc_con->is_connected : -1,
+			msc->msc_con ? msc->msc_con->is_authenticated : -1,
+			VTY_NEWLINE);
+	}
+
+	return CMD_SUCCESS;
+}
+
 int bsc_vty_init_extra(void)
 {
 	install_element(CONFIG_NODE, &cfg_net_msc_cmd);
@@ -377,6 +394,7 @@
 	install_element(MSC_NODE, &cfg_net_rf_socket_cmd);
 
 	install_element_ve(&show_statistics_cmd);
+	install_element_ve(&show_mscs_cmd);
 
 	return 0;
 }