diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-07-13 02:03:50 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-08-30 14:14:58 +0200 |
commit | ee6cfdc0d9710e3a69c8e1939eb21c8f2b759885 (patch) | |
tree | ed5aeb0979a1838778649078847a1ed6caa6b1a4 /src/gprs/gb_proxy_main.c | |
parent | 6c809185ee86d318d10205756bb6d91914d11fdf (diff) |
split off osmo-sgsn: remove files, apply build1.1.0
Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f
Diffstat (limited to 'src/gprs/gb_proxy_main.c')
-rw-r--r-- | src/gprs/gb_proxy_main.c | 35 |
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); |