aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-21 10:20:29 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-21 10:24:18 +0100
commitb1461152e6945a747ef2d65ee5908cc5d59acbbd (patch)
tree6ea553fdd8e794384315e18778b07387b0bdcd69 /openbsc/src
parentb1edf7b64f6c05932c83b4d31b1127f2a833601e (diff)
bsc: Allow to apply configuration for an individual BTS
This will drop a specific IP based BTS. It will lead to a re-connect of the BTS and the new settings will be applied then. Fixes: SYS#737
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libbsc/bsc_ctrl_commands.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index 64f78636e..fde825be8 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -1,6 +1,6 @@
/*
- * (C) 2013 by Holger Hans Peter Freyther
- * (C) 2013 by sysmocom s.f.m.c. GmbH
+ * (C) 2013-2014 by Holger Hans Peter Freyther
+ * (C) 2013-2014 by sysmocom s.f.m.c. GmbH
*
* All Rights Reserved
*
@@ -156,6 +156,33 @@ CTRL_CMD_DEFINE(net_mcc_mnc_apply, "mcc-mnc-apply");
/* BTS related commands below */
CTRL_CMD_DEFINE_RANGE(bts_lac, "location-area-code", struct gsm_bts, location_area_code, 0, 65535);
+static int verify_bts_apply_config(struct ctrl_cmd *cmd, const char *v, void *d)
+{
+ return 0;
+}
+
+static int get_bts_apply_config(struct ctrl_cmd *cmd, void *data)
+{
+ cmd->reply = "Write only attribute";
+ return CTRL_CMD_ERROR;
+}
+
+static int set_bts_apply_config(struct ctrl_cmd *cmd, void *data)
+{
+ struct gsm_bts *bts = cmd->node;
+
+ if (!is_ipaccess_bts(bts)) {
+ cmd->reply = "BTS is not IP based";
+ return CTRL_CMD_ERROR;
+ }
+
+ ipaccess_drop_oml(bts);
+ cmd->reply = "Tried to drop the BTS";
+ return CTRL_CMD_REPLY;
+}
+
+CTRL_CMD_DEFINE(bts_apply_config, "apply-configuration");
+
/* TRX related commands below here */
CTRL_HELPER_GET_INT(trx_max_power, struct gsm_bts_trx, max_power_red);
static int verify_trx_max_power(struct ctrl_cmd *cmd, const char *value, void *_data)
@@ -207,6 +234,7 @@ int bsc_base_ctrl_cmds_install(void)
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc_mnc_apply);
rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_lac);
+ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_apply_config);
rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power);
return rc;