aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/nat/bsc_nat_vty.c')
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index d8af1c23f..0bbd313a9 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -29,6 +29,7 @@
#include <osmocore/talloc.h>
#include <osmocore/rate_ctr.h>
+#include <osmocore/utils.h>
#include <osmocom/sccp/sccp.h>
@@ -121,7 +122,7 @@ DEFUN(show_sccp, show_sccp_cmd, "show sccp connections",
sccp_src_ref_to_int(&con->patched_ref),
con->has_remote_ref,
sccp_src_ref_to_int(&con->remote_ref),
- con->msc_timeslot, con->bsc_timeslot,
+ con->msc_endp, con->bsc_endp,
bsc_con_type_to_string(con->con_type),
VTY_NEWLINE);
}
@@ -148,6 +149,30 @@ DEFUN(show_bsc, show_bsc_cmd, "show bsc connections",
return CMD_SUCCESS;
}
+DEFUN(show_bsc_mgcp, show_bsc_mgcp_cmd, "show bsc mgcp NR",
+ SHOW_STR "Display the MGCP status for a given BSC")
+{
+ struct bsc_connection *con;
+ int nr = atoi(argv[0]);
+ int i;
+
+ llist_for_each_entry(con, &_nat->bsc_connections, list_entry) {
+ if (!con->cfg)
+ continue;
+ if (con->cfg->nr != nr)
+ continue;
+
+ vty_out(vty, "MGCP Status for %d%s", con->cfg->nr, VTY_NEWLINE);
+ for (i = 1; i < ARRAY_SIZE(con->endpoint_status); ++i)
+ vty_out(vty, " Endpoint 0x%x %s%s", i,
+ con->endpoint_status[i] == 0 ? "free" : "allocated",
+ VTY_NEWLINE);
+ break;
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN(show_bsc_cfg, show_bsc_cfg_cmd, "show bsc config",
SHOW_STR "Display information about known BSC configs")
{
@@ -564,6 +589,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
install_element_ve(&close_bsc_cmd);
install_element_ve(&show_msc_cmd);
install_element_ve(&test_regex_cmd);
+ install_element_ve(&show_bsc_mgcp_cmd);
/* nat group */
install_element(CONFIG_NODE, &cfg_nat_cmd);