aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-19 15:08:35 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-19 16:01:14 +0800
commit4f705b9f99867ecc8495a9d26ed92eef33af8749 (patch)
tree257d59411aae39a7b53e06e1ee131f46eec48877
parentc592e697ce6bb26e56dbec19274673d73c25626d (diff)
[vty] Add a test command to allocate all SDCCH
-rw-r--r--openbsc/src/vty_interface.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index 05a1d680..df643c9c 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -234,6 +234,28 @@ DEFUN(show_bts, show_bts_cmd, "show bts [number]",
return CMD_SUCCESS;
}
+DEFUN(test_bts_lchan_alloc, test_bts_lchan_alloc_cmd, "test bts alloc sdcch",
+ "Test command to allocate all channels. You will need to restart. To free these channels.\n")
+{
+ struct gsm_network *net = gsmnet;
+ int bts_nr;
+
+ enum gsm_chan_t type = GSM_LCHAN_NONE;
+
+ type = GSM_LCHAN_SDCCH;
+
+ for (bts_nr = 0; bts_nr < net->num_bts; ++bts_nr) {
+ struct gsm_bts *bts = gsm_bts_num(net, bts_nr);
+ struct gsm_lchan *lchan;
+
+ /* alloc the channel */
+ while ((lchan = lchan_alloc(bts, type, 0)) != NULL)
+ rsl_lchan_set_state(lchan, LCHAN_S_REL_ERR);
+ }
+
+ return CMD_SUCCESS;
+}
+
/* utility functions */
static void parse_e1_link(struct gsm_e1_subslot *e1_link, const char *line,
const char *ts, const char *ss)
@@ -1953,6 +1975,7 @@ int bsc_vty_init(struct gsm_network *net)
install_element(VIEW_NODE, &show_paging_cmd);
install_element(VIEW_NODE, &drop_bts_cmd);
+ install_element(VIEW_NODE, &test_bts_lchan_alloc_cmd);
openbsc_vty_add_cmds();