aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-13 02:41:37 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-13 02:41:37 +0200
commit2b6d39c9e0b741b124739064983470bc717826c8 (patch)
treeebb171f4124c4c3a5da53b2f994a830198767d7e /src/gprs
parent63c09b18f3bca32548260af11a42b2fb03ffb376 (diff)
add specific code bits
Diffstat (limited to 'src/gprs')
-rw-r--r--src/gprs/gb_proxy.c2
-rw-r--r--src/gprs/gb_proxy_main.c33
2 files changed, 32 insertions, 3 deletions
diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c
index d95139f8d..bfbbf8df6 100644
--- a/src/gprs/gb_proxy.c
+++ b/src/gprs/gb_proxy.c
@@ -53,6 +53,8 @@
#include <openssl/rand.h>
+extern void *tall_bsc_ctx;
+
static const struct rate_ctr_desc global_ctr_description[] = {
{ "inv-bvci", "Invalid BVC Identifier " },
{ "inv-lai", "Invalid Location Area Identifier" },
diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c
index 69a93b6f7..27aae6ae3 100644
--- a/src/gprs/gb_proxy_main.c
+++ b/src/gprs/gb_proxy_main.c
@@ -189,13 +189,40 @@ static void handle_options(int argc, char **argv)
}
}
-extern int bsc_vty_go_parent(struct vty *vty);
+int gbproxy_vty_is_config_node(struct vty *vty, int node)
+{
+ switch (node) {
+ /* add items that are not config */
+ case CONFIG_NODE:
+ return 0;
+
+ default:
+ return 1;
+ }
+}
+
+int gbproxy_vty_go_parent(struct vty *vty)
+{
+ switch (vty->node) {
+ case GBPROXY_NODE:
+ case SGSN_NODE:
+ default:
+ if (gbproxy_vty_is_config_node(vty, vty->node))
+ vty->node = CONFIG_NODE;
+ else
+ vty->node = ENABLE_NODE;
+
+ vty->index = NULL;
+ }
+
+ return vty->node;
+}
static struct vty_app_info vty_info = {
.name = "OsmoGbProxy",
.version = PACKAGE_VERSION,
- .go_parent_cb = bsc_vty_go_parent,
- .is_config_node = bsc_vty_is_config_node,
+ .go_parent_cb = gbproxy_vty_go_parent,
+ .is_config_node = gbproxy_vty_is_config_node,
};
/* default categories */