aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-02-28 18:09:25 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-04-22 09:09:33 +0200
commita13f6dfd82b4efa14dea452a380949f9b17892bb (patch)
tree529dded3e4733343d971e0f491ef4d784bfc4a65
parent15c9d7fb57b6a63a5aa51732104a6ae6613163e3 (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 93e1d7ac1..3444e2162 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 ctrl_commands.c
+osmo_nitb_SOURCES = bsc_hack.c ctrl_commands.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 063d384e6..6c8adbc3a 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -68,6 +68,7 @@ static int use_db_counter = 1;
static struct osmo_timer_list db_sync_timer;
extern int bsc_ctrl_cmds_install(void);
+extern int bsc_ctrl_cmds_install_dummies(void);
static void create_pcap_file(char *file)
{
@@ -296,6 +297,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;
+}