split off osmo-sgsn: remove files, apply build
Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f
diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c
index caff27f..853a763 100644
--- a/src/gprs/gb_proxy_main.c
+++ b/src/gprs/gb_proxy_main.c
@@ -190,13 +190,39 @@
}
}
-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 @@
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 @@
}
/* 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);