aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-02-28 18:09:25 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-06 23:05:13 +0100
commitdf9243764333e26c4333f57e47f053f5cba7c89c (patch)
tree6bce0dde46953105859b6c762a3f6fed028c2837
parentc38743c550c2506978fc05aa48f1dfcaee95d8bf (diff)
DUMMY: Add a stub for enabling/disabling of Meas TRAP reporting
-rw-r--r--openbsc/src/osmo-nitb/Makefile.am2
-rw-r--r--openbsc/src/osmo-nitb/bsc_hack.c5
-rw-r--r--openbsc/src/osmo-nitb/ctrl_commands_dummy.c56
3 files changed, 62 insertions, 1 deletions
diff --git a/openbsc/src/osmo-nitb/Makefile.am b/openbsc/src/osmo-nitb/Makefile.am
index fe285cb20..865d23410 100644
--- a/openbsc/src/osmo-nitb/Makefile.am
+++ b/openbsc/src/osmo-nitb/Makefile.am
@@ -7,7 +7,7 @@ AM_LDFLAGS = $(COVERAGE_LDFLAGS)
bin_PROGRAMS = osmo-nitb
-osmo_nitb_SOURCES = bsc_hack.c
+osmo_nitb_SOURCES = bsc_hack.c ctrl_commands_dummy.c
osmo_nitb_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libmsc/libmsc.a \
diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c
index 67c65ce61..c36c823ae 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -67,6 +67,7 @@ static int use_db_counter = 1;
static struct osmo_timer_list db_sync_timer;
+extern int bsc_ctrl_cmds_install_dummies(void);
static void create_pcap_file(char *file)
{
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
@@ -294,6 +295,10 @@ int main(int argc, char **argv)
printf("Failed to initialize the control commands. Exiting.\n");
return -1;
}
+ if (bsc_ctrl_cmds_install_dummies() != 0) {
+ printf("Failed to initialize the control commands dummies. Exiting.\n");
+ return -1;
+ }
/* seed the PRNG */
srand(time(NULL));
diff --git a/openbsc/src/osmo-nitb/ctrl_commands_dummy.c b/openbsc/src/osmo-nitb/ctrl_commands_dummy.c
new file mode 100644
index 000000000..e2e3e97ed
--- /dev/null
+++ b/openbsc/src/osmo-nitb/ctrl_commands_dummy.c
@@ -0,0 +1,56 @@
+/*
+ * (C) 2013 by Holger Hans Peter Freyther
+ * (C) 2013 by sysmocom s.f.m.c. GmbH
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <openbsc/control_cmd.h>
+#include <openbsc/gsm_data.h>
+
+int dummy_set(struct ctrl_cmd *cmd, void *data)
+{
+ cmd->reply = "Dummy implementation";
+ return CTRL_CMD_REPLY;
+}
+
+int dummy_get(struct ctrl_cmd *cmd, void *data)
+{
+ cmd->reply = "0";
+ return CTRL_CMD_REPLY;
+}
+
+int dummy_verify(struct ctrl_cmd *cmd, const char *value, void *data)
+{
+ return 0;
+}
+
+#define DUMMY_COMMAND(name, str) \
+ CTRL_CMD_RAW(name, str, dummy_get, dummy_set, dummy_verify)
+
+/* ROOT related commands below here */
+DUMMY_COMMAND(net_trap_meas_enable, "trap-measurement-reports-enable");
+
+
+int bsc_ctrl_cmds_install_dummies(void)
+{
+ int rc = 0;
+
+ rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_trap_meas_enable);
+
+ return rc;
+}