aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/gb_proxy_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gprs/gb_proxy_main.c')
-rw-r--r--src/gprs/gb_proxy_main.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c
index caff27f6f..853a763a2 100644
--- a/src/gprs/gb_proxy_main.c
+++ b/src/gprs/gb_proxy_main.c
@@ -190,13 +190,39 @@ 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:
+ 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 */
@@ -226,7 +252,6 @@ static const struct log_info gprs_log_info = {
int main(int argc, char **argv)
{
- struct gsm_network dummy_network;
int rc;
tall_bsc_ctx = talloc_named_const(NULL, 0, "nsip_proxy");
@@ -271,7 +296,7 @@ int main(int argc, char **argv)
}
/* start telnet after reading config for vty_get_bind_addr() */
- rc = telnet_init_dynif(tall_bsc_ctx, &dummy_network,
+ rc = telnet_init_dynif(tall_bsc_ctx, NULL,
vty_get_bind_addr(), OSMO_VTY_PORT_GBPROXY);
if (rc < 0)
exit(1);