aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/vty.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-27 11:25:35 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-27 11:25:35 +0200
commitc6b4c87e5d57b91b29894835e7ac8e42f6e67f32 (patch)
tree2dfca5a61c881e88e6f29d03c29bb26e1c643332 /src/common/vty.c
parent8e47fb89bfd0e2b54b714393ac2a80ca76df56a9 (diff)
re-work original osmo-bts with support for sysmocom femtobts
This code re-works osmo-bts to add support for the upcoming sysmocom BTS. It also tries to add some level of abstraction between the generic part of a BTS (A-bis, RSL, OML, data structures, paging scheduling, BCCH/AGCH scheduling, etc.) and the actual hardware-specific bits. The hardware-specific bits are currently only implemented for the sysmocom femtobts, but should be (re-)added for osmocom-bb, as well as a virtual BTS for simulation purpose later. The sysmocom bts specific parts require hardware-specific header files which are (at least currently) not publicly distributed.
Diffstat (limited to 'src/common/vty.c')
-rw-r--r--src/common/vty.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
new file mode 100644
index 00000000..d2cda2fb
--- /dev/null
+++ b/src/common/vty.c
@@ -0,0 +1,61 @@
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <osmocom/vty/vty.h>
+
+#include <osmo-bts/vty.h>
+
+enum node_type bts_vty_go_parent(struct vty *vty)
+{
+ switch (vty->node) {
+ default:
+ vty->node = CONFIG_NODE;
+ }
+ return vty->node;
+}
+
+int bts_vty_is_config_node(struct vty *vty, int node)
+{
+ switch (node) {
+ default:
+ return 0;
+ }
+}
+
+gDEFUN(ournode_exit, ournode_exit_cmd, "exit",
+ "Exit current node, go down to provious node")
+{
+ switch (vty->node) {
+ default:
+ break;
+ }
+ return CMD_SUCCESS;
+}
+
+gDEFUN(ournode_end, ournode_end_cmd, "end",
+ "End current mode and change to enable mode")
+{
+ switch (vty->node) {
+ default:
+ vty_config_unlock(vty);
+ vty->node = ENABLE_NODE;
+ vty->index = NULL;
+ vty->index_sub = NULL;
+ break;
+ }
+ return CMD_SUCCESS;
+}
+
+struct vty_app_info bts_vty_info = {
+ .name = "OsmoBTS",
+ .version = PACKAGE_VERSION,
+ .go_parent_cb = bts_vty_go_parent,
+ .is_config_node = bts_vty_is_config_node,
+};
+
+const char *osmobts_copyright =
+ "Copyright (C) 2010, 2011 by Harald Welte and Andreas Eversberg\r\n"
+ "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n"
+ "This is free software: you are free to change and redistribute it.\r\n"
+ "There is NO WARRANTY, to the extent permitted by law.\r\n";