aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-01-09 17:30:11 +0100
committerIvan Kluchnikov <kluchnikovi@gmail.com>2014-01-13 16:04:08 +0400
commit39bb62cd6f0ed2b77d51a48b8030f4d36c3bdddd (patch)
tree3171742cbb5f1b05efadec34f2603d37b69d8608
parentcec7eaed8f912780d81d23eb50283bb837269ea1 (diff)
nitb: Add ctrl command to apply the configuration
Right now this only works for IP based BTS like the sysmoBTS and by dropping the OML link.
-rw-r--r--openbsc/src/osmo-nitb/ctrl_commands.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/openbsc/src/osmo-nitb/ctrl_commands.c b/openbsc/src/osmo-nitb/ctrl_commands.c
index e8833b8cf..aeac6840b 100644
--- a/openbsc/src/osmo-nitb/ctrl_commands.c
+++ b/openbsc/src/osmo-nitb/ctrl_commands.c
@@ -20,6 +20,7 @@
*/
#include <openbsc/control_cmd.h>
+#include <openbsc/ipaccess.h>
#include <openbsc/gsm_data.h>
#include <osmocom/vty/misc.h>
@@ -90,6 +91,35 @@ static int get_net_save_config(struct ctrl_cmd *cmd, void *data)
CTRL_CMD_DEFINE(net_save_config, "save-configuration");
+static int verify_net_apply_config(struct ctrl_cmd *cmd, const char *v, void *d)
+{
+ return 0;
+}
+
+static int get_net_apply_config(struct ctrl_cmd *cmd, void *data)
+{
+ cmd->reply = "Write only attribute";
+ return CTRL_CMD_ERROR;
+}
+
+static int set_net_apply_config(struct ctrl_cmd *cmd, void *data)
+{
+ struct gsm_network *net = cmd->node;
+ struct gsm_bts *bts;
+
+ llist_for_each_entry(bts, &net->bts_list, list) {
+ if (!is_ipaccess_bts(bts))
+ continue;
+
+ ipaccess_drop_oml(bts);
+ }
+
+ cmd->reply = "Tried to drop the BTS";
+ return CTRL_CMD_REPLY;
+}
+
+CTRL_CMD_DEFINE(net_apply_config, "apply-configuration");
+
int bsc_ctrl_cmds_install(void)
{
int rc = 0;
@@ -97,6 +127,7 @@ int bsc_ctrl_cmds_install(void)
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_short_name);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_long_name);
+ rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_apply_config);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_save_config);
return rc;